/****************************************************************
 * Fulguro
 * Copyright (C) 2004 Christophe Clienti
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 ***************************************************************/


#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <flgrCoreDispatch.h>
#include <flgrCoreDataIO.h>
#include <flgrCoreMalloc.h>
#include <flgrCoreArithDef.h>
#include "flgrArith.h"
#include "flgrArithSSE.h"
#include "flgrArithSSE2.h"

/*!
 * \defgroup group_fulguro_arith Arithmetic and logic operations
 * Arithmetic and logic operations
 * \defgroup group_fulguro_arith_twoimg Diadic
 * \ingroup group_fulguro_arith
 * @{
 */


/****************************************************************************************************/
/****************************************************************************************************/
/****************************************************************************************************/
/******************************************* 1D Functions *******************************************/
/****************************************************************************************************/
/****************************************************************************************************/
/****************************************************************************************************/


#define FLGR_MACRO_ARITH_1D_DIADIC(dtypedest,dtype1,dtype2,operator)	\
  int j;								\
  dtype1 *psrc1 = (dtype1*) data1->array;				\
  dtype2 *psrc2 = (dtype2*) data2->array;				\
  dtypedest *pdest = (dtypedest*) datdest->array;			\
  dtype1 v1;								\
  dtype2 v2;								\
  dtypedest result;							\
  int spp = datdest->spp;						\
  int length = datdest->length*spp;					\
									\
  FLGR_DECLARE_FUNCTION;						\
									\
  for(j=0 ; j<length ; j++) {						\
    v1 = flgr1d_get_data_array_##dtype1(psrc1,j);			\
    v2 = flgr1d_get_data_array_##dtype2(psrc2,j);			\
    result = operator(v1,v2);						\
    flgr1d_set_data_array_##dtypedest(pdest,j,result);			\
  }									\
  return

#define FLGR_MACRO_ARITH_1D_MONOADIC(dtypedest,dtype1,operator)		\
  int j;								\
  dtype1 *psrc1 = (dtype1*) data1->array;				\
  dtypedest *pdest = (dtypedest*) datdest->array;			\
  dtype1 v1;								\
  dtypedest result;							\
  int spp = datdest->spp;						\
  int length = datdest->length*spp;					\
									\
  FLGR_DECLARE_FUNCTION;						\
									\
  for(j=0 ; j<length ; j++) {						\
    v1 = flgr1d_get_data_array_##dtype1(psrc1,j);			\
    result = operator(v1);						\
    flgr1d_set_data_array_##dtypedest(pdest,j,result);			\
  }									\
  return

#define FLGR_MACRO_ARITH_1D_MONOADIC_PARAM(dtypedest,dtype1,operator)	\
  int j;								\
  dtype1 *psrc1 = (dtype1*) data1->array;				\
  dtypedest *pdest = (dtypedest*) datdest->array;			\
  dtype1 v1;								\
  dtypedest result;							\
  int spp = datdest->spp;						\
  int length = datdest->length*spp;					\
									\
  FLGR_DECLARE_FUNCTION;						\
									\
  for(j=0 ; j<length ; j++) {						\
    v1 = flgr1d_get_data_array_##dtype1(psrc1,j);			\
    result = operator(v1);						\
    flgr1d_set_data_array_##dtypedest(pdest,j,result);			\
  }									\
  return

#define FLGR_MACRO_ARITH_1D_DIADIC_CONST(dtypedest,dtype1,operator)	\
  int j;								\
  dtype1 *psrc1 = (dtype1*) data1->array;				\
  dtype1 *constant = (dtype1*) vec_const->array;			\
  dtypedest *pdest = (dtypedest*) datdest->array;			\
  dtype1 v1;								\
  dtypedest result;							\
  int spp = datdest->spp;						\
  int length = datdest->length*spp;					\
  									\
  FLGR_DECLARE_FUNCTION;						\
									\
  for(j=0 ; j<length ; j++) {						\
    v1 = flgr1d_get_data_array_##dtype1(psrc1,j);			\
    result = operator(v1,flgr_get_array_##dtype1(constant,j%spp));	\
    flgr1d_set_data_array_##dtypedest(pdest,j,result);			\
  }									\
  return



/*******************************************************************************
 * INF
 *******************************************************************************/

void flgr1d_arith_inf_fgBIT(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  #ifdef __SSE2__
     flgr1d_arith_inf_SSE2_fgBIT(datdest,data1,data2);
  #else
    #ifdef __SSE__
       flgr1d_arith_inf_SSE_fgBIT(datdest,data1,data2);
    #else
       FLGR_MACRO_ARITH_1D_DIADIC(fgBIT,fgBIT,fgBIT,flgr_defop_inf_fgBIT);
    #endif
  #endif
}
void flgr1d_arith_inf_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  #ifdef __SSE2__
     flgr1d_arith_inf_SSE2_fgUINT8(datdest,data1,data2);
  #else
    #ifdef __SSE__
       flgr1d_arith_inf_SSE_fgUINT8(datdest,data1,data2);
    #else
       FLGR_MACRO_ARITH_1D_DIADIC(fgUINT8,fgUINT8,fgUINT8,flgr_defop_inf_fgUINT8);
    #endif
  #endif
}
void flgr1d_arith_inf_fgUINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  FLGR_MACRO_ARITH_1D_DIADIC(fgUINT16,fgUINT16,fgUINT16,flgr_defop_inf_fgUINT16);
}
void flgr1d_arith_inf_fgUINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  FLGR_MACRO_ARITH_1D_DIADIC(fgUINT32,fgUINT32,fgUINT32,flgr_defop_inf_fgUINT32);
}
void flgr1d_arith_inf_fgINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  FLGR_MACRO_ARITH_1D_DIADIC(fgINT8,fgINT8,fgINT8,flgr_defop_inf_fgINT8);
}
void flgr1d_arith_inf_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  #ifdef __SSE2__
     flgr1d_arith_inf_SSE2_fgINT16(datdest,data1,data2);
  #else
    #ifdef __SSE__
       flgr1d_arith_inf_SSE_fgINT16(datdest,data1,data2);
    #else
       FLGR_MACRO_ARITH_1D_DIADIC(fgINT16,fgINT16,fgINT16,flgr_defop_inf_fgINT16);
    #endif
  #endif
}
void flgr1d_arith_inf_fgINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  FLGR_MACRO_ARITH_1D_DIADIC(fgINT32,fgINT32,fgINT32,flgr_defop_inf_fgINT32);
}
void flgr1d_arith_inf_fgFLOAT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  FLGR_MACRO_ARITH_1D_DIADIC(fgFLOAT32,fgFLOAT32,fgFLOAT32,flgr_defop_inf_fgFLOAT32);
}
void flgr1d_arith_inf_fgFLOAT64(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  FLGR_MACRO_ARITH_1D_DIADIC(fgFLOAT64,fgFLOAT64,fgFLOAT64,flgr_defop_inf_fgFLOAT64);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Inf element by element over two FLGR_Data1D
 *  @param datdest : pointer to FLGR_Data1D
 *  @param data1 : pointer to FLGR_Data1D
 *  @param data2 : pointer to FLGR_Data1D
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr1d_arith_inf(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  FLGR_Ret ret;

  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL) || (data2==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr1d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;
  if((ret = flgr1d_is_data_same_attributes(data2,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr1d_arith_inf,datdest,data1,data2);

}


/*******************************************************************************
 * SUP
 *******************************************************************************/

void flgr1d_arith_sup_fgBIT(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  #ifdef __SSE2__
     flgr1d_arith_sup_SSE2_fgBIT(datdest,data1,data2);
  #else
    #ifdef __SSE__
       flgr1d_arith_sup_SSE_fgBIT(datdest,data1,data2);
    #else
       FLGR_MACRO_ARITH_1D_DIADIC(fgBIT,fgBIT,fgBIT,flgr_defop_sup_fgBIT);
    #endif
  #endif
}
void flgr1d_arith_sup_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  #ifdef __SSE2__
     flgr1d_arith_sup_SSE2_fgUINT8(datdest,data1,data2);
  #else
    #ifdef __SSE__
       flgr1d_arith_sup_SSE_fgUINT8(datdest,data1,data2);
    #else
       FLGR_MACRO_ARITH_1D_DIADIC(fgUINT8,fgUINT8,fgUINT8,flgr_defop_sup_fgUINT8);
    #endif
  #endif
}
void flgr1d_arith_sup_fgUINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  FLGR_MACRO_ARITH_1D_DIADIC(fgUINT16,fgUINT16,fgUINT16,flgr_defop_sup_fgUINT16);
}
void flgr1d_arith_sup_fgUINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  FLGR_MACRO_ARITH_1D_DIADIC(fgUINT32,fgUINT32,fgUINT32,flgr_defop_sup_fgUINT32);
}
void flgr1d_arith_sup_fgINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  FLGR_MACRO_ARITH_1D_DIADIC(fgINT8,fgINT8,fgINT8,flgr_defop_sup_fgINT8);
}
void flgr1d_arith_sup_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  #ifdef __SSE2__
     flgr1d_arith_sup_SSE2_fgINT16(datdest,data1,data2);
  #else
    #ifdef __SSE__
       flgr1d_arith_sup_SSE_fgINT16(datdest,data1,data2);
    #else
       FLGR_MACRO_ARITH_1D_DIADIC(fgINT16,fgINT16,fgINT16,flgr_defop_sup_fgINT16);
    #endif
  #endif
}
void flgr1d_arith_sup_fgINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  FLGR_MACRO_ARITH_1D_DIADIC(fgINT32,fgINT32,fgINT32,flgr_defop_sup_fgINT32);
}
void flgr1d_arith_sup_fgFLOAT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  FLGR_MACRO_ARITH_1D_DIADIC(fgFLOAT32,fgFLOAT32,fgFLOAT32,flgr_defop_sup_fgFLOAT32);
}
void flgr1d_arith_sup_fgFLOAT64(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  FLGR_MACRO_ARITH_1D_DIADIC(fgFLOAT64,fgFLOAT64,fgFLOAT64,flgr_defop_sup_fgFLOAT64);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Sup element by element over two FLGR_Data1D
 *  @param datdest : pointer to FLGR_Data1D
 *  @param data1 : pointer to FLGR_Data1D
 *  @param data2 : pointer to FLGR_Data1D
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr1d_arith_sup(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  FLGR_Ret ret;

  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL) || (data2==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr1d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;
  if((ret = flgr1d_is_data_same_attributes(data2,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr1d_arith_sup,datdest,data1,data2);

}

/*******************************************************************************
 * AND
 *******************************************************************************/

void flgr1d_arith_and_fgBIT(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  #ifdef __SSE2__
     flgr1d_arith_and_SSE2_fgBIT(datdest,data1,data2);
  #else
    #ifdef __SSE__
       flgr1d_arith_and_SSE_fgBIT(datdest,data1,data2);
    #else
       FLGR_MACRO_ARITH_1D_DIADIC(fgBIT,fgBIT,fgBIT,flgr_defop_and_fgBIT);
    #endif
  #endif
}
void flgr1d_arith_and_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  #ifdef __SSE2__
     flgr1d_arith_and_SSE2_fgUINT8(datdest,data1,data2);
  #else
    #ifdef __SSE__
       flgr1d_arith_and_SSE_fgUINT8(datdest,data1,data2);
    #else
       FLGR_MACRO_ARITH_1D_DIADIC(fgUINT8,fgUINT8,fgUINT8,flgr_defop_and_fgUINT8);
    #endif
  #endif
}
void flgr1d_arith_and_fgUINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  #ifdef __SSE2__
     flgr1d_arith_and_SSE2_fgUINT16(datdest,data1,data2);
  #else
    #ifdef __SSE__
       flgr1d_arith_and_SSE_fgUINT16(datdest,data1,data2);
    #else
       FLGR_MACRO_ARITH_1D_DIADIC(fgUINT16,fgUINT16,fgUINT16,flgr_defop_and_fgUINT16);
    #endif
  #endif
}
void flgr1d_arith_and_fgUINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  #ifdef __SSE2__
     flgr1d_arith_and_SSE2_fgUINT32(datdest,data1,data2);
  #else
    #ifdef __SSE__
       flgr1d_arith_and_SSE_fgUINT32(datdest,data1,data2);
    #else
       FLGR_MACRO_ARITH_1D_DIADIC(fgUINT32,fgUINT32,fgUINT32,flgr_defop_and_fgUINT32);
    #endif
  #endif
}
void flgr1d_arith_and_fgINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  #ifdef __SSE2__
     flgr1d_arith_and_SSE2_fgINT8(datdest,data1,data2);
  #else
    #ifdef __SSE__
       flgr1d_arith_and_SSE_fgINT8(datdest,data1,data2);
    #else
       FLGR_MACRO_ARITH_1D_DIADIC(fgINT8,fgINT8,fgINT8,flgr_defop_and_fgINT8);
    #endif
  #endif
}
void flgr1d_arith_and_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  #ifdef __SSE2__
     flgr1d_arith_and_SSE2_fgINT16(datdest,data1,data2);
  #else
    #ifdef __SSE__
       flgr1d_arith_and_SSE_fgINT16(datdest,data1,data2);
    #else
       FLGR_MACRO_ARITH_1D_DIADIC(fgINT16,fgINT16,fgINT16,flgr_defop_and_fgINT16);
    #endif
  #endif
}
void flgr1d_arith_and_fgINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  #ifdef __SSE2__
     flgr1d_arith_and_SSE2_fgINT32(datdest,data1,data2);
  #else
    #ifdef __SSE__
       flgr1d_arith_and_SSE_fgINT32(datdest,data1,data2);
    #else
       FLGR_MACRO_ARITH_1D_DIADIC(fgINT32,fgINT32,fgINT32,flgr_defop_and_fgINT32);
    #endif
  #endif
}
void flgr1d_arith_and_fgFLOAT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  flgr_no_define_type_function(FLGR_FLOAT32);
}
void flgr1d_arith_and_fgFLOAT64(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  flgr_no_define_type_function(FLGR_FLOAT64);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute And element by element over two FLGR_Data1D
 *  @param datdest : pointer to FLGR_Data1D
 *  @param data1 : pointer to FLGR_Data1D
 *  @param data2 : pointer to FLGR_Data1D
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr1d_arith_and(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  FLGR_Ret ret;

  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL) || (data2==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr1d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;
  if((ret = flgr1d_is_data_same_attributes(data2,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr1d_arith_and,datdest,data1,data2);

}


/*******************************************************************************
 * OR
 *******************************************************************************/

void flgr1d_arith_or_fgBIT(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  #ifdef __SSE2__
     flgr1d_arith_or_SSE2_fgBIT(datdest,data1,data2);
  #else
    #ifdef __SSE__
       flgr1d_arith_or_SSE_fgBIT(datdest,data1,data2);
    #else
       FLGR_MACRO_ARITH_1D_DIADIC(fgBIT,fgBIT,fgBIT,flgr_defop_or_fgBIT);
    #endif
  #endif
}
void flgr1d_arith_or_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  #ifdef __SSE2__
     flgr1d_arith_or_SSE2_fgUINT8(datdest,data1,data2);
  #else
    #ifdef __SSE__
       flgr1d_arith_or_SSE_fgUINT8(datdest,data1,data2);
    #else
       FLGR_MACRO_ARITH_1D_DIADIC(fgUINT8,fgUINT8,fgUINT8,flgr_defop_or_fgUINT8);
    #endif
  #endif
}
void flgr1d_arith_or_fgUINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  #ifdef __SSE2__
     flgr1d_arith_or_SSE2_fgUINT16(datdest,data1,data2);
  #else
    #ifdef __SSE__
       flgr1d_arith_or_SSE_fgUINT16(datdest,data1,data2);
    #else
       FLGR_MACRO_ARITH_1D_DIADIC(fgUINT16,fgUINT16,fgUINT16,flgr_defop_or_fgUINT16);
    #endif
  #endif
}
void flgr1d_arith_or_fgUINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  #ifdef __SSE2__
     flgr1d_arith_or_SSE2_fgUINT32(datdest,data1,data2);
  #else
    #ifdef __SSE__
       flgr1d_arith_or_SSE_fgUINT32(datdest,data1,data2);
    #else
       FLGR_MACRO_ARITH_1D_DIADIC(fgUINT32,fgUINT32,fgUINT32,flgr_defop_or_fgUINT32);
    #endif
  #endif
}
void flgr1d_arith_or_fgINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  #ifdef __SSE2__
     flgr1d_arith_or_SSE2_fgINT8(datdest,data1,data2);
  #else
    #ifdef __SSE__
       flgr1d_arith_or_SSE_fgINT8(datdest,data1,data2);
    #else
       FLGR_MACRO_ARITH_1D_DIADIC(fgINT8,fgINT8,fgINT8,flgr_defop_or_fgINT8);
    #endif
  #endif
}
void flgr1d_arith_or_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  #ifdef __SSE2__
     flgr1d_arith_or_SSE2_fgINT16(datdest,data1,data2);
  #else
    #ifdef __SSE__
       flgr1d_arith_or_SSE_fgINT16(datdest,data1,data2);
    #else
       FLGR_MACRO_ARITH_1D_DIADIC(fgINT16,fgINT16,fgINT16,flgr_defop_or_fgINT16);
    #endif
  #endif
}
void flgr1d_arith_or_fgINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  #ifdef __SSE2__
     flgr1d_arith_or_SSE2_fgINT32(datdest,data1,data2);
  #else
    #ifdef __SSE__
       flgr1d_arith_or_SSE_fgINT32(datdest,data1,data2);
    #else
       FLGR_MACRO_ARITH_1D_DIADIC(fgINT32,fgINT32,fgINT32,flgr_defop_or_fgINT32);
    #endif
  #endif
}
void flgr1d_arith_or_fgFLOAT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  flgr_no_define_type_function(FLGR_FLOAT32);
}
void flgr1d_arith_or_fgFLOAT64(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  flgr_no_define_type_function(FLGR_FLOAT64);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Or element by element over two FLGR_Data1D
 *  @param datdest : pointer to FLGR_Data1D
 *  @param data1 : pointer to FLGR_Data1D
 *  @param data2 : pointer to FLGR_Data1D
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr1d_arith_or(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  FLGR_Ret ret;
  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL) || (data2==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr1d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;
  if((ret = flgr1d_is_data_same_attributes(data2,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr1d_arith_or,datdest,data1,data2);

}


/*******************************************************************************
 * XOR
 *******************************************************************************/

void flgr1d_arith_xor_fgBIT(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  #ifdef __SSE2__
     flgr1d_arith_xor_SSE2_fgBIT(datdest,data1,data2);
  #else
    #ifdef __SSE__
       flgr1d_arith_xor_SSE_fgBIT(datdest,data1,data2);
    #else
       FLGR_MACRO_ARITH_1D_DIADIC(fgBIT,fgBIT,fgBIT,flgr_defop_xor_fgBIT);
    #endif
  #endif
}
void flgr1d_arith_xor_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  #ifdef __SSE2__
     flgr1d_arith_xor_SSE2_fgUINT8(datdest,data1,data2);
  #else
    #ifdef __SSE__
       flgr1d_arith_xor_SSE_fgUINT8(datdest,data1,data2);
    #else
       FLGR_MACRO_ARITH_1D_DIADIC(fgUINT8,fgUINT8,fgUINT8,flgr_defop_xor_fgUINT8);
    #endif
  #endif
}
void flgr1d_arith_xor_fgUINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  #ifdef __SSE2__
     flgr1d_arith_xor_SSE2_fgUINT16(datdest,data1,data2);
  #else
    #ifdef __SSE__
       flgr1d_arith_xor_SSE_fgUINT16(datdest,data1,data2);
    #else
       FLGR_MACRO_ARITH_1D_DIADIC(fgUINT16,fgUINT16,fgUINT16,flgr_defop_xor_fgUINT16);
    #endif
  #endif
}
void flgr1d_arith_xor_fgUINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  #ifdef __SSE2__
     flgr1d_arith_xor_SSE2_fgUINT32(datdest,data1,data2);
  #else
    #ifdef __SSE__
       flgr1d_arith_xor_SSE_fgUINT32(datdest,data1,data2);
    #else
       FLGR_MACRO_ARITH_1D_DIADIC(fgUINT32,fgUINT32,fgUINT32,flgr_defop_xor_fgUINT32);
    #endif
  #endif
}
void flgr1d_arith_xor_fgINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  #ifdef __SSE2__
     flgr1d_arith_xor_SSE2_fgINT8(datdest,data1,data2);
  #else
    #ifdef __SSE__
       flgr1d_arith_xor_SSE_fgINT8(datdest,data1,data2);
    #else
       FLGR_MACRO_ARITH_1D_DIADIC(fgINT8,fgINT8,fgINT8,flgr_defop_xor_fgINT8);
    #endif
  #endif
}
void flgr1d_arith_xor_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  #ifdef __SSE2__
     flgr1d_arith_xor_SSE2_fgINT16(datdest,data1,data2);
  #else
    #ifdef __SSE__
       flgr1d_arith_xor_SSE_fgINT16(datdest,data1,data2);
    #else
       FLGR_MACRO_ARITH_1D_DIADIC(fgINT16,fgINT16,fgINT16,flgr_defop_xor_fgINT16);
    #endif
  #endif
}
void flgr1d_arith_xor_fgINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  #ifdef __SSE2__
     flgr1d_arith_xor_SSE2_fgINT32(datdest,data1,data2);
  #else
    #ifdef __SSE__
       flgr1d_arith_xor_SSE_fgINT32(datdest,data1,data2);
    #else
       FLGR_MACRO_ARITH_1D_DIADIC(fgINT32,fgINT32,fgINT32,flgr_defop_xor_fgINT32);
    #endif
  #endif
}
void flgr1d_arith_xor_fgFLOAT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  flgr_no_define_type_function(FLGR_FLOAT32);
}
void flgr1d_arith_xor_fgFLOAT64(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  flgr_no_define_type_function(FLGR_FLOAT64);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Xor element by element over two FLGR_Data1D
 *  @param datdest : pointer to FLGR_Data1D
 *  @param data1 : pointer to FLGR_Data1D
 *  @param data2 : pointer to FLGR_Data1D
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr1d_arith_xor(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  FLGR_Ret ret;
  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL) || (data2==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr1d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;
  if((ret = flgr1d_is_data_same_attributes(data2,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr1d_arith_xor,datdest,data1,data2);

}


/*******************************************************************************
 * ATAN2
 *******************************************************************************/

void flgr1d_arith_atan2_fgBIT(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  flgr_no_define_type_function(FLGR_BIT);
}
void flgr1d_arith_atan2_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  flgr_no_define_type_function(FLGR_UINT8);
}
void flgr1d_arith_atan2_fgUINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  flgr_no_define_type_function(FLGR_UINT16);
}
void flgr1d_arith_atan2_fgUINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  flgr_no_define_type_function(FLGR_UINT32);
}
void flgr1d_arith_atan2_fgINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  flgr_no_define_type_function(FLGR_INT8);
}
void flgr1d_arith_atan2_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  flgr_no_define_type_function(FLGR_INT16);
}
void flgr1d_arith_atan2_fgINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  flgr_no_define_type_function(FLGR_INT32);
}
void flgr1d_arith_atan2_fgFLOAT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  FLGR_MACRO_ARITH_1D_DIADIC(fgFLOAT32,fgFLOAT32,fgFLOAT32,flgr_defop_atan2_fgFLOAT32);
}
void flgr1d_arith_atan2_fgFLOAT64(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  FLGR_MACRO_ARITH_1D_DIADIC(fgFLOAT64,fgFLOAT64,fgFLOAT64,flgr_defop_atan2_fgFLOAT64);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Atan2 element by element over two FLGR_Data1D
 *  @param datdest : pointer to FLGR_Data1D
 *  @param data1 : pointer to FLGR_Data1D
 *  @param data2 : pointer to FLGR_Data1D
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr1d_arith_atan2(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  FLGR_Ret ret;
  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL) || (data2==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr1d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;
  if((ret = flgr1d_is_data_same_attributes(data2,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr1d_arith_atan2,datdest,data1,data2);

}


/*******************************************************************************
 * ARGUMENT
 *******************************************************************************/

void flgr1d_arith_argument_fgBIT(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  flgr_no_define_type_function(FLGR_BIT);
}
void flgr1d_arith_argument_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  FLGR_MACRO_ARITH_1D_DIADIC(fgUINT8,fgUINT8,fgUINT8,flgr_defop_argument_fgUINT8);
}
void flgr1d_arith_argument_fgUINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  FLGR_MACRO_ARITH_1D_DIADIC(fgUINT16,fgUINT16,fgUINT16,flgr_defop_argument_fgUINT16);
}
void flgr1d_arith_argument_fgUINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  FLGR_MACRO_ARITH_1D_DIADIC(fgUINT32,fgUINT32,fgUINT32,flgr_defop_argument_fgUINT32);
}
void flgr1d_arith_argument_fgINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  FLGR_MACRO_ARITH_1D_DIADIC(fgINT8,fgINT8,fgINT8,flgr_defop_argument_fgINT8);
}
void flgr1d_arith_argument_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  FLGR_MACRO_ARITH_1D_DIADIC(fgINT16,fgINT16,fgINT16,flgr_defop_argument_fgINT16);
}
void flgr1d_arith_argument_fgINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  FLGR_MACRO_ARITH_1D_DIADIC(fgINT32,fgINT32,fgINT32,flgr_defop_argument_fgINT32);
}
void flgr1d_arith_argument_fgFLOAT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  FLGR_MACRO_ARITH_1D_DIADIC(fgFLOAT32,fgFLOAT32,fgFLOAT32,flgr_defop_argument_fgFLOAT32);
}
void flgr1d_arith_argument_fgFLOAT64(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  FLGR_MACRO_ARITH_1D_DIADIC(fgFLOAT64,fgFLOAT64,fgFLOAT64,flgr_defop_argument_fgFLOAT64);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Argument element by element over two FLGR_Data1D
 *  @param datdest : pointer to FLGR_Data1D
 *  @param data1 : pointer to FLGR_Data1D
 *  @param data2 : pointer to FLGR_Data1D
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr1d_arith_argument(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  FLGR_Ret ret;
  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL) || (data2==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr1d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;
  if((ret = flgr1d_is_data_same_attributes(data2,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr1d_arith_argument,datdest,data1,data2);

}



/*******************************************************************************
 * MODULE
 *******************************************************************************/

void flgr1d_arith_module_fgBIT(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  flgr_no_define_type_function(FLGR_BIT);
}
void flgr1d_arith_module_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  FLGR_MACRO_ARITH_1D_DIADIC(fgUINT8,fgUINT8,fgUINT8,flgr_defop_module_fgUINT8);
}
void flgr1d_arith_module_fgUINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  FLGR_MACRO_ARITH_1D_DIADIC(fgUINT16,fgUINT16,fgUINT16,flgr_defop_module_fgUINT16);
}
void flgr1d_arith_module_fgUINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  FLGR_MACRO_ARITH_1D_DIADIC(fgUINT32,fgUINT32,fgUINT32,flgr_defop_module_fgUINT32);
}
void flgr1d_arith_module_fgINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  FLGR_MACRO_ARITH_1D_DIADIC(fgINT8,fgINT8,fgINT8,flgr_defop_module_fgINT8);
}
void flgr1d_arith_module_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  FLGR_MACRO_ARITH_1D_DIADIC(fgINT16,fgINT16,fgINT16,flgr_defop_module_fgINT16);
}
void flgr1d_arith_module_fgINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  FLGR_MACRO_ARITH_1D_DIADIC(fgINT32,fgINT32,fgINT32,flgr_defop_module_fgINT32);
}
void flgr1d_arith_module_fgFLOAT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  FLGR_MACRO_ARITH_1D_DIADIC(fgFLOAT32,fgFLOAT32,fgFLOAT32,flgr_defop_module_fgFLOAT32);
}
void flgr1d_arith_module_fgFLOAT64(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  FLGR_MACRO_ARITH_1D_DIADIC(fgFLOAT64,fgFLOAT64,fgFLOAT64,flgr_defop_module_fgFLOAT64);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Module element by element over two FLGR_Data1D
 *  @param datdest : pointer to FLGR_Data1D
 *  @param data1 : pointer to FLGR_Data1D
 *  @param data2 : pointer to FLGR_Data1D
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr1d_arith_module(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  FLGR_Ret ret;
  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL) || (data2==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr1d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;
  if((ret = flgr1d_is_data_same_attributes(data2,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr1d_arith_module,datdest,data1,data2);

}


/*******************************************************************************
 * MULTSAT
 *******************************************************************************/

void flgr1d_arith_multsat_fgBIT(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  flgr_no_define_type_function(FLGR_BIT);
}
void flgr1d_arith_multsat_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  FLGR_MACRO_ARITH_1D_DIADIC(fgUINT8,fgUINT8,fgUINT8,flgr_defop_multsat_fgUINT8);
}
void flgr1d_arith_multsat_fgUINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  FLGR_MACRO_ARITH_1D_DIADIC(fgUINT16,fgUINT16,fgUINT16,flgr_defop_multsat_fgUINT16);
}
void flgr1d_arith_multsat_fgUINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  FLGR_MACRO_ARITH_1D_DIADIC(fgUINT32,fgUINT32,fgUINT32,flgr_defop_multsat_fgUINT32);
}
void flgr1d_arith_multsat_fgINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  FLGR_MACRO_ARITH_1D_DIADIC(fgINT8,fgINT8,fgINT8,flgr_defop_multsat_fgINT8);
}
void flgr1d_arith_multsat_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  FLGR_MACRO_ARITH_1D_DIADIC(fgINT16,fgINT16,fgINT16,flgr_defop_multsat_fgINT16);
}
void flgr1d_arith_multsat_fgINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  FLGR_MACRO_ARITH_1D_DIADIC(fgINT32,fgINT32,fgINT32,flgr_defop_multsat_fgINT32);
}
void flgr1d_arith_multsat_fgFLOAT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  flgr_no_define_type_function(FLGR_FLOAT32);
}
void flgr1d_arith_multsat_fgFLOAT64(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  flgr_no_define_type_function(FLGR_FLOAT64);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Multsat element by element over two FLGR_Data1D
 *  @param datdest : pointer to FLGR_Data1D
 *  @param data1 : pointer to FLGR_Data1D
 *  @param data2 : pointer to FLGR_Data1D
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr1d_arith_multsat(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  FLGR_Ret ret;
  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL) || (data2==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr1d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;
  if((ret = flgr1d_is_data_same_attributes(data2,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr1d_arith_multsat,datdest,data1,data2);

}



/*******************************************************************************
 * SUBSAT
 *******************************************************************************/

void flgr1d_arith_subsat_fgBIT(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  flgr_no_define_type_function(FLGR_BIT);
}
void flgr1d_arith_subsat_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  #ifdef __SSE2__
     flgr1d_arith_subsat_SSE2_fgUINT8(datdest,data1,data2);
  #else
    #ifdef __SSE__
       flgr1d_arith_subsat_SSE_fgUINT8(datdest,data1,data2);
    #else
       FLGR_MACRO_ARITH_1D_DIADIC(fgUINT8,fgUINT8,fgUINT8,flgr_defop_subsat_fgUINT8);
    #endif
  #endif
}
void flgr1d_arith_subsat_fgUINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  #ifdef __SSE2__
     flgr1d_arith_subsat_SSE2_fgUINT16(datdest,data1,data2);
  #else
    #ifdef __SSE__
       flgr1d_arith_subsat_SSE_fgUINT16(datdest,data1,data2);
    #else
       FLGR_MACRO_ARITH_1D_DIADIC(fgUINT16,fgUINT16,fgUINT16,flgr_defop_subsat_fgUINT16);
    #endif
  #endif
}
void flgr1d_arith_subsat_fgUINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  FLGR_MACRO_ARITH_1D_DIADIC(fgUINT32,fgUINT32,fgUINT32,flgr_defop_subsat_fgUINT32);
}
void flgr1d_arith_subsat_fgINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  FLGR_MACRO_ARITH_1D_DIADIC(fgINT8,fgINT8,fgINT8,flgr_defop_subsat_fgINT8);
}
void flgr1d_arith_subsat_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  #ifdef __SSE2__
     flgr1d_arith_subsat_SSE2_fgINT16(datdest,data1,data2);
  #else
    #ifdef __SSE__
       flgr1d_arith_subsat_SSE_fgINT16(datdest,data1,data2);
    #else
       FLGR_MACRO_ARITH_1D_DIADIC(fgINT16,fgINT16,fgINT16,flgr_defop_subsat_fgINT16);
    #endif
  #endif
}
void flgr1d_arith_subsat_fgINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  FLGR_MACRO_ARITH_1D_DIADIC(fgINT32,fgINT32,fgINT32,flgr_defop_subsat_fgINT32);
}
void flgr1d_arith_subsat_fgFLOAT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  flgr_no_define_type_function(FLGR_FLOAT32);
}
void flgr1d_arith_subsat_fgFLOAT64(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  flgr_no_define_type_function(FLGR_FLOAT64);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Subsat element by element over two FLGR_Data1D
 *  @param datdest : pointer to FLGR_Data1D
 *  @param data1 : pointer to FLGR_Data1D
 *  @param data2 : pointer to FLGR_Data1D
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr1d_arith_subsat(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  FLGR_Ret ret;
  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL) || (data2==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr1d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;
  if((ret = flgr1d_is_data_same_attributes(data2,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr1d_arith_subsat,datdest,data1,data2);

}



/*******************************************************************************
 * ADDSAT
 *******************************************************************************/

void flgr1d_arith_addsat_fgBIT(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  flgr_no_define_type_function(FLGR_BIT);
}
void flgr1d_arith_addsat_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  #ifdef __SSE2__
     flgr1d_arith_addsat_SSE2_fgUINT8(datdest,data1,data2);
  #else
    #ifdef __SSE__
       flgr1d_arith_addsat_SSE_fgUINT8(datdest,data1,data2);
    #else
       FLGR_MACRO_ARITH_1D_DIADIC(fgUINT8,fgUINT8,fgUINT8,flgr_defop_addsat_fgUINT8);
    #endif
  #endif
}
void flgr1d_arith_addsat_fgUINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  #ifdef __SSE2__
     flgr1d_arith_addsat_SSE2_fgUINT16(datdest,data1,data2);
  #else
    #ifdef __SSE__
       flgr1d_arith_addsat_SSE_fgUINT16(datdest,data1,data2);
    #else
       FLGR_MACRO_ARITH_1D_DIADIC(fgUINT16,fgUINT16,fgUINT16,flgr_defop_addsat_fgUINT16);
    #endif
  #endif
}
void flgr1d_arith_addsat_fgUINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  FLGR_MACRO_ARITH_1D_DIADIC(fgUINT32,fgUINT32,fgUINT32,flgr_defop_addsat_fgUINT32);
}
void flgr1d_arith_addsat_fgINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  FLGR_MACRO_ARITH_1D_DIADIC(fgINT8,fgINT8,fgINT8,flgr_defop_addsat_fgINT8);
}
void flgr1d_arith_addsat_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  #ifdef __SSE2__
     flgr1d_arith_addsat_SSE2_fgINT16(datdest,data1,data2);
  #else
    #ifdef __SSE__
       flgr1d_arith_addsat_SSE_fgINT16(datdest,data1,data2);
    #else
       FLGR_MACRO_ARITH_1D_DIADIC(fgINT16,fgINT16,fgINT16,flgr_defop_addsat_fgINT16);
    #endif
  #endif
}
void flgr1d_arith_addsat_fgINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  FLGR_MACRO_ARITH_1D_DIADIC(fgINT32,fgINT32,fgINT32,flgr_defop_addsat_fgINT32);
}
void flgr1d_arith_addsat_fgFLOAT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  flgr_no_define_type_function(FLGR_FLOAT32);
}
void flgr1d_arith_addsat_fgFLOAT64(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  flgr_no_define_type_function(FLGR_FLOAT64);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Addsat element by element over two FLGR_Data1D
 *  @param datdest : pointer to FLGR_Data1D
 *  @param data1 : pointer to FLGR_Data1D
 *  @param data2 : pointer to FLGR_Data1D
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr1d_arith_addsat(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  FLGR_Ret ret;
  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL) || (data2==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr1d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;
  if((ret = flgr1d_is_data_same_attributes(data2,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr1d_arith_addsat,datdest,data1,data2);

}



/*******************************************************************************
 * DIV
 *******************************************************************************/

void flgr1d_arith_div_fgBIT(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  flgr_no_define_type_function(FLGR_BIT);
}
void flgr1d_arith_div_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  FLGR_MACRO_ARITH_1D_DIADIC(fgUINT8,fgUINT8,fgUINT8,flgr_defop_div_fgUINT8);
}
void flgr1d_arith_div_fgUINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  FLGR_MACRO_ARITH_1D_DIADIC(fgUINT16,fgUINT16,fgUINT16,flgr_defop_div_fgUINT16);
}
void flgr1d_arith_div_fgUINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  FLGR_MACRO_ARITH_1D_DIADIC(fgUINT32,fgUINT32,fgUINT32,flgr_defop_div_fgUINT32);
}
void flgr1d_arith_div_fgINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  FLGR_MACRO_ARITH_1D_DIADIC(fgINT8,fgINT8,fgINT8,flgr_defop_div_fgINT8);
}
void flgr1d_arith_div_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  FLGR_MACRO_ARITH_1D_DIADIC(fgINT16,fgINT16,fgINT16,flgr_defop_div_fgINT16);
}
void flgr1d_arith_div_fgINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  FLGR_MACRO_ARITH_1D_DIADIC(fgINT32,fgINT32,fgINT32,flgr_defop_div_fgINT32);
}
void flgr1d_arith_div_fgFLOAT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  FLGR_MACRO_ARITH_1D_DIADIC(fgFLOAT32,fgFLOAT32,fgFLOAT32,flgr_defop_div_fgFLOAT32);
}
void flgr1d_arith_div_fgFLOAT64(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  FLGR_MACRO_ARITH_1D_DIADIC(fgFLOAT64,fgFLOAT64,fgFLOAT64,flgr_defop_div_fgFLOAT64);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Div element by element over two FLGR_Data1D
 *  @param datdest : pointer to FLGR_Data1D
 *  @param data1 : pointer to FLGR_Data1D
 *  @param data2 : pointer to FLGR_Data1D
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr1d_arith_div(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  FLGR_Ret ret;

  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL) || (data2==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr1d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;
  if((ret = flgr1d_is_data_same_attributes(data2,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr1d_arith_div,datdest,data1,data2);

}



/*******************************************************************************
 * MULT
 *******************************************************************************/

void flgr1d_arith_mult_fgBIT(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  flgr_no_define_type_function(FLGR_BIT);
}
void flgr1d_arith_mult_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  FLGR_MACRO_ARITH_1D_DIADIC(fgUINT8,fgUINT8,fgUINT8,flgr_defop_mult_fgUINT8);
}
void flgr1d_arith_mult_fgUINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  FLGR_MACRO_ARITH_1D_DIADIC(fgUINT16,fgUINT16,fgUINT16,flgr_defop_mult_fgUINT16);
}
void flgr1d_arith_mult_fgUINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  FLGR_MACRO_ARITH_1D_DIADIC(fgUINT32,fgUINT32,fgUINT32,flgr_defop_mult_fgUINT32);
}
void flgr1d_arith_mult_fgINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  FLGR_MACRO_ARITH_1D_DIADIC(fgINT8,fgINT8,fgINT8,flgr_defop_mult_fgINT8);
}
void flgr1d_arith_mult_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  FLGR_MACRO_ARITH_1D_DIADIC(fgINT16,fgINT16,fgINT16,flgr_defop_mult_fgINT16);
}
void flgr1d_arith_mult_fgINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  FLGR_MACRO_ARITH_1D_DIADIC(fgINT32,fgINT32,fgINT32,flgr_defop_mult_fgINT32);
}
void flgr1d_arith_mult_fgFLOAT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  FLGR_MACRO_ARITH_1D_DIADIC(fgFLOAT32,fgFLOAT32,fgFLOAT32,flgr_defop_mult_fgFLOAT32);
}
void flgr1d_arith_mult_fgFLOAT64(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  FLGR_MACRO_ARITH_1D_DIADIC(fgFLOAT64,fgFLOAT64,fgFLOAT64,flgr_defop_mult_fgFLOAT64);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Mult element by element over two FLGR_Data1D
 *  @param datdest : pointer to FLGR_Data1D
 *  @param data1 : pointer to FLGR_Data1D
 *  @param data2 : pointer to FLGR_Data1D
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr1d_arith_mult(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  FLGR_Ret ret;

  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL) || (data2==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr1d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;
  if((ret = flgr1d_is_data_same_attributes(data2,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr1d_arith_mult,datdest,data1,data2);

}


/*******************************************************************************
 * SUB
 *******************************************************************************/

void flgr1d_arith_sub_fgBIT(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  #ifdef __SSE2__
     flgr1d_arith_sub_SSE2_fgBIT(datdest,data1,data2);
  #else
    #ifdef __SSE__
       flgr1d_arith_sub_SSE_fgBIT(datdest,data1,data2);
    #else
       FLGR_MACRO_ARITH_1D_DIADIC(fgBIT,fgBIT,fgBIT,flgr_defop_xor_fgBIT);
    #endif
  #endif
}
void flgr1d_arith_sub_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  #ifdef __SSE2__
     flgr1d_arith_sub_SSE2_fgUINT8(datdest,data1,data2);
  #else
    #ifdef __SSE__
       flgr1d_arith_sub_SSE_fgUINT8(datdest,data1,data2);
    #else
       FLGR_MACRO_ARITH_1D_DIADIC(fgUINT8,fgUINT8,fgUINT8,flgr_defop_sub_a_b_fgUINT8);
    #endif
  #endif
}
void flgr1d_arith_sub_fgUINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  #ifdef __SSE2__
     flgr1d_arith_sub_SSE2_fgUINT16(datdest,data1,data2);
  #else
    #ifdef __SSE__
       flgr1d_arith_sub_SSE_fgUINT16(datdest,data1,data2);
    #else
       FLGR_MACRO_ARITH_1D_DIADIC(fgUINT16,fgUINT16,fgUINT16,flgr_defop_sub_a_b_fgUINT16);
    #endif
  #endif
}
void flgr1d_arith_sub_fgUINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  FLGR_MACRO_ARITH_1D_DIADIC(fgUINT32,fgUINT32,fgUINT32,flgr_defop_sub_a_b_fgUINT32);
}
void flgr1d_arith_sub_fgINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  #ifdef __SSE2__
     flgr1d_arith_sub_SSE2_fgINT8(datdest,data1,data2);
  #else
    #ifdef __SSE__
       flgr1d_arith_sub_SSE_fgINT8(datdest,data1,data2);
    #else
       FLGR_MACRO_ARITH_1D_DIADIC(fgINT8,fgINT8,fgINT8,flgr_defop_sub_a_b_fgINT8);
    #endif
  #endif
}
void flgr1d_arith_sub_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  #ifdef __SSE2__
     flgr1d_arith_sub_SSE2_fgINT16(datdest,data1,data2);
  #else
    #ifdef __SSE__
       flgr1d_arith_sub_SSE_fgINT16(datdest,data1,data2);
    #else
       FLGR_MACRO_ARITH_1D_DIADIC(fgINT16,fgINT16,fgINT16,flgr_defop_sub_a_b_fgINT16);
    #endif
  #endif
}
void flgr1d_arith_sub_fgINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  FLGR_MACRO_ARITH_1D_DIADIC(fgINT32,fgINT32,fgINT32,flgr_defop_sub_a_b_fgINT32);
}
void flgr1d_arith_sub_fgFLOAT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  FLGR_MACRO_ARITH_1D_DIADIC(fgFLOAT32,fgFLOAT32,fgFLOAT32,flgr_defop_sub_a_b_fgFLOAT32);
}
void flgr1d_arith_sub_fgFLOAT64(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  FLGR_MACRO_ARITH_1D_DIADIC(fgFLOAT64,fgFLOAT64,fgFLOAT64,flgr_defop_sub_a_b_fgFLOAT64);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Sub element by element over two FLGR_Data1D
 *  @param datdest : pointer to FLGR_Data1D
 *  @param data1 : pointer to FLGR_Data1D
 *  @param data2 : pointer to FLGR_Data1D
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr1d_arith_sub(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  FLGR_Ret ret;

  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL) || (data2==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr1d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;
  if((ret = flgr1d_is_data_same_attributes(data2,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr1d_arith_sub,datdest,data1,data2);

}


/*******************************************************************************
 * ADD
 *******************************************************************************/

void flgr1d_arith_add_fgBIT(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  #ifdef __SSE2__
     flgr1d_arith_add_SSE2_fgBIT(datdest,data1,data2);
  #else
    #ifdef __SSE__
       flgr1d_arith_add_SSE_fgBIT(datdest,data1,data2);
    #else
       FLGR_MACRO_ARITH_1D_DIADIC(fgBIT,fgBIT,fgBIT,flgr_defop_xor_fgBIT);
    #endif
  #endif
}
void flgr1d_arith_add_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  #ifdef __SSE2__
     flgr1d_arith_add_SSE2_fgUINT8(datdest,data1,data2);
  #else
    #ifdef __SSE__
       flgr1d_arith_add_SSE_fgUINT8(datdest,data1,data2);
    #else
       FLGR_MACRO_ARITH_1D_DIADIC(fgUINT8,fgUINT8,fgUINT8,flgr_defop_add_fgUINT8);
    #endif
  #endif
}
void flgr1d_arith_add_fgUINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  #ifdef __SSE2__
     flgr1d_arith_add_SSE2_fgUINT16(datdest,data1,data2);
  #else
    #ifdef __SSE__
       flgr1d_arith_add_SSE_fgUINT16(datdest,data1,data2);
    #else
       FLGR_MACRO_ARITH_1D_DIADIC(fgUINT16,fgUINT16,fgUINT16,flgr_defop_add_fgUINT16);
    #endif
  #endif
}
void flgr1d_arith_add_fgUINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  FLGR_MACRO_ARITH_1D_DIADIC(fgUINT32,fgUINT32,fgUINT32,flgr_defop_add_fgUINT32);
}
void flgr1d_arith_add_fgINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  #ifdef __SSE2__
     flgr1d_arith_add_SSE2_fgINT8(datdest,data1,data2);
  #else
    #ifdef __SSE__
       flgr1d_arith_add_SSE_fgINT8(datdest,data1,data2);
    #else
       FLGR_MACRO_ARITH_1D_DIADIC(fgINT8,fgINT8,fgINT8,flgr_defop_add_fgINT8);
    #endif
  #endif
}
void flgr1d_arith_add_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  #ifdef __SSE2__
     flgr1d_arith_add_SSE2_fgINT16(datdest,data1,data2);
  #else
    #ifdef __SSE__
       flgr1d_arith_add_SSE_fgINT16(datdest,data1,data2);
    #else
       FLGR_MACRO_ARITH_1D_DIADIC(fgINT16,fgINT16,fgINT16,flgr_defop_add_fgINT16);
    #endif
  #endif
}
void flgr1d_arith_add_fgINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  FLGR_MACRO_ARITH_1D_DIADIC(fgINT32,fgINT32,fgINT32,flgr_defop_add_fgINT32);
}
void flgr1d_arith_add_fgFLOAT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  FLGR_MACRO_ARITH_1D_DIADIC(fgFLOAT32,fgFLOAT32,fgFLOAT32,flgr_defop_add_fgFLOAT32);
}
void flgr1d_arith_add_fgFLOAT64(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  FLGR_MACRO_ARITH_1D_DIADIC(fgFLOAT64,fgFLOAT64,fgFLOAT64,flgr_defop_add_fgFLOAT64);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Add element by element over two FLGR_Data1D
 *  @param datdest : pointer to FLGR_Data1D
 *  @param data1 : pointer to FLGR_Data1D
 *  @param data2 : pointer to FLGR_Data1D
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr1d_arith_add(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Data1D *data2) {
  FLGR_Ret ret;

  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL) || (data2==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr1d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;
  if((ret = flgr1d_is_data_same_attributes(data2,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr1d_arith_add,datdest,data1,data2);

}





/*******************************************************************************
 *******************************************************************************
 *******************************************************************************
 * DIADIC CONST OPERATIONS
 *******************************************************************************
 *******************************************************************************
 *******************************************************************************/


/*******************************************************************************
 * INF CONST
 *******************************************************************************/

void flgr1d_arith_const_inf_fgBIT(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgBIT,fgBIT,flgr_defop_inf_fgBIT);
}
void flgr1d_arith_const_inf_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  #ifdef __SSE2__
    if(datdest->spp==1) {
      flgr1d_arith_const_inf_spp1_SSE2_fgUINT8(datdest,data1,vec_const);
    }else {
      FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT8,fgUINT8,flgr_defop_inf_fgUINT8);
    }
  #else
    #ifdef __SSE__
      if(datdest->spp==1) {
        flgr1d_arith_const_inf_spp1_SSE_fgUINT8(datdest,data1,vec_const);
      }else {
        FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT8,fgUINT8,flgr_defop_inf_fgUINT8);
      }
    #else
       FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT8,fgUINT8,flgr_defop_inf_fgUINT8);
    #endif
  #endif
}
void flgr1d_arith_const_inf_fgUINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT16,fgUINT16,flgr_defop_inf_fgUINT16);
}
void flgr1d_arith_const_inf_fgUINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT32,fgUINT32,flgr_defop_inf_fgUINT32);
}
void flgr1d_arith_const_inf_fgINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgINT8,fgINT8,flgr_defop_inf_fgINT8);
}
void flgr1d_arith_const_inf_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  #ifdef __SSE2__
    if(datdest->spp==1) {
      flgr1d_arith_const_inf_spp1_SSE2_fgINT16(datdest,data1,vec_const);
    }else {
      FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgINT16,fgINT16,flgr_defop_inf_fgINT16);
    }
  #else
    #ifdef __SSE__
      if(datdest->spp==1) {
        flgr1d_arith_const_inf_spp1_SSE_fgINT16(datdest,data1,vec_const);
      }else {
        FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgINT16,fgINT16,flgr_defop_inf_fgINT16);
      }
    #else
       FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgINT16,fgINT16,flgr_defop_inf_fgINT16);
    #endif
  #endif
}
void flgr1d_arith_const_inf_fgINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgINT32,fgINT32,flgr_defop_inf_fgINT32);
}
void flgr1d_arith_const_inf_fgFLOAT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgFLOAT32,fgFLOAT32,flgr_defop_inf_fgFLOAT32);
}
void flgr1d_arith_const_inf_fgFLOAT64(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgFLOAT64,fgFLOAT64,flgr_defop_inf_fgFLOAT64);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Inf with a constant every pixels
 *  @param datdest : pointer to FLGR_Data1D
 *  @param data1 : pointer to FLGR_Data1D
 *  @param vec_const : pointer to a Vector
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr1d_arith_const_inf_ptr(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_Ret ret;

  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr1d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr1d_arith_const_inf,datdest,data1,vec_const);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Inf with a constant every pixels
 *  @param datdest : pointer to FLGR_Data1D
 *  @param data1 : pointer to FLGR_Data1D
 *  @param constant : string representing a constant
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr1d_arith_const_inf_str(FLGR_Data1D *datdest, FLGR_Data1D *data1, char *constant) {
  int ret;
  FLGR_Vector *vector_constant;

  if((data1==NULL) || (datdest==NULL))  {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  vector_constant = flgr_vector_create(data1->spp,data1->type);

  if((ret=flgr_vector_import_string(vector_constant, constant))
     != FLGR_RET_OK) {

    POST_ERROR("String is not valid ""%s""\n",constant);
    flgr_vector_destroy(vector_constant);
    return ret;
  }


  ret = flgr1d_arith_const_inf_ptr(datdest,data1,vector_constant);

  flgr_vector_destroy(vector_constant);

  return ret;

}




/*******************************************************************************
 * SUP CONST
 *******************************************************************************/

void flgr1d_arith_const_sup_fgBIT(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgBIT,fgBIT,flgr_defop_sup_fgBIT);
}
void flgr1d_arith_const_sup_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  #ifdef __SSE2__
    if(datdest->spp==1) {
      flgr1d_arith_const_sup_spp1_SSE2_fgUINT8(datdest,data1,vec_const);
    }else {
      FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT8,fgUINT8,flgr_defop_sup_fgUINT8);
    }
  #else
    #ifdef __SSE__
      if(datdest->spp==1) {
        flgr1d_arith_const_sup_spp1_SSE_fgUINT8(datdest,data1,vec_const);
      }else {
        FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT8,fgUINT8,flgr_defop_sup_fgUINT8);
      }
    #else
       FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT8,fgUINT8,flgr_defop_sup_fgUINT8);
    #endif
  #endif
}
void flgr1d_arith_const_sup_fgUINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT16,fgUINT16,flgr_defop_sup_fgUINT16);
}
void flgr1d_arith_const_sup_fgUINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT32,fgUINT32,flgr_defop_sup_fgUINT32);
}
void flgr1d_arith_const_sup_fgINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgINT8,fgINT8,flgr_defop_sup_fgINT8);
}
void flgr1d_arith_const_sup_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  #ifdef __SSE2__
    if(datdest->spp==1) {
      flgr1d_arith_const_sup_spp1_SSE2_fgINT16(datdest,data1,vec_const);
    }else {
      FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgINT16,fgINT16,flgr_defop_sup_fgINT16);
    }
  #else
    #ifdef __SSE__
      if(datdest->spp==1) {
        flgr1d_arith_const_sup_spp1_SSE_fgINT16(datdest,data1,vec_const);
      }else {
        FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgINT16,fgINT16,flgr_defop_sup_fgINT16);
      }
    #else
       FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgINT16,fgINT16,flgr_defop_sup_fgINT16);
    #endif
  #endif
}
void flgr1d_arith_const_sup_fgINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgINT32,fgINT32,flgr_defop_sup_fgINT32);
}
void flgr1d_arith_const_sup_fgFLOAT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgFLOAT32,fgFLOAT32,flgr_defop_sup_fgFLOAT32);
}
void flgr1d_arith_const_sup_fgFLOAT64(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgFLOAT64,fgFLOAT64,flgr_defop_sup_fgFLOAT64);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Sup with a constant every pixels
 *  @param datdest : pointer to FLGR_Data1D
 *  @param data1 : pointer to FLGR_Data1D
 *  @param vec_const : pointer to a Vector
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr1d_arith_const_sup_ptr(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_Ret ret;

  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr1d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr1d_arith_const_sup,datdest,data1,vec_const);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Sup with a constant every pixels
 *  @param datdest : pointer to FLGR_Data1D
 *  @param data1 : pointer to FLGR_Data1D
 *  @param constant : string representing a constant
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr1d_arith_const_sup_str(FLGR_Data1D *datdest, FLGR_Data1D *data1, char *constant) {
  int ret;
  FLGR_Vector *vector_constant;

  if((data1==NULL) || (datdest==NULL))  {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  vector_constant = flgr_vector_create(data1->spp,data1->type);

  if((ret=flgr_vector_import_string(vector_constant, constant))
     != FLGR_RET_OK) {

    POST_ERROR("String is not valid ""%s""\n",constant);
    flgr_vector_destroy(vector_constant);
    return ret;
  }

  ret = flgr1d_arith_const_sup_ptr(datdest,data1,vector_constant);

  flgr_vector_destroy(vector_constant);


  return ret;

}



/*******************************************************************************
 * AND CONST
 *******************************************************************************/

void flgr1d_arith_const_and_fgBIT(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgBIT,fgBIT,flgr_defop_and_fgBIT);
}
void flgr1d_arith_const_and_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  #ifdef __SSE2__
    if(datdest->spp==1) {
      flgr1d_arith_const_and_spp1_SSE2_fgUINT8(datdest,data1,vec_const);
    }else {
      FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT8,fgUINT8,flgr_defop_and_fgUINT8);
    }
  #else
    #ifdef __SSE__
      if(datdest->spp==1) {
        flgr1d_arith_const_and_spp1_SSE_fgUINT8(datdest,data1,vec_const);
      }else {
        FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT8,fgUINT8,flgr_defop_and_fgUINT8);
      }
    #else
       FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT8,fgUINT8,flgr_defop_and_fgUINT8);
    #endif
  #endif
}
void flgr1d_arith_const_and_fgUINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  #ifdef __SSE2__
    if(datdest->spp==1) {
      flgr1d_arith_const_and_spp1_SSE2_fgUINT16(datdest,data1,vec_const);
    }else {
      FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT16,fgUINT16,flgr_defop_and_fgUINT16);
    }
  #else
    #ifdef __SSE__
      if(datdest->spp==1) {
        flgr1d_arith_const_and_spp1_SSE_fgUINT16(datdest,data1,vec_const);
      }else {
        FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT16,fgUINT16,flgr_defop_and_fgUINT16);
      }
    #else
       FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT16,fgUINT16,flgr_defop_and_fgUINT16);
    #endif
  #endif
}
void flgr1d_arith_const_and_fgUINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  #ifdef __SSE2__
    if(datdest->spp==1) {
      flgr1d_arith_const_and_spp1_SSE2_fgUINT32(datdest,data1,vec_const);
    }else {
      FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT32,fgUINT32,flgr_defop_and_fgUINT32);
    }
  #else
    #ifdef __SSE__
      if(datdest->spp==1) {
        flgr1d_arith_const_and_spp1_SSE_fgUINT32(datdest,data1,vec_const);
      }else {
        FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT32,fgUINT32,flgr_defop_and_fgUINT32);
      }
    #else
       FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT32,fgUINT32,flgr_defop_and_fgUINT32);
    #endif
  #endif
}
void flgr1d_arith_const_and_fgINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  #ifdef __SSE2__
    if(datdest->spp==1) {
      flgr1d_arith_const_and_spp1_SSE2_fgINT8(datdest,data1,vec_const);
    }else {
      FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgINT8,fgINT8,flgr_defop_and_fgINT8);
    }
  #else
    #ifdef __SSE__
      if(datdest->spp==1) {
        flgr1d_arith_const_and_spp1_SSE_fgINT8(datdest,data1,vec_const);
      }else {
        FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgINT8,fgINT8,flgr_defop_and_fgINT8);
      }
    #else
       FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgINT8,fgINT8,flgr_defop_and_fgINT8);
    #endif
  #endif
}
void flgr1d_arith_const_and_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  #ifdef __SSE2__
    if(datdest->spp==1) {
      flgr1d_arith_const_and_spp1_SSE2_fgINT16(datdest,data1,vec_const);
    }else {
      FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgINT16,fgINT16,flgr_defop_and_fgINT16);
    }
  #else
    #ifdef __SSE__
      if(datdest->spp==1) {
        flgr1d_arith_const_and_spp1_SSE_fgINT16(datdest,data1,vec_const);
      }else {
        FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgINT16,fgINT16,flgr_defop_and_fgINT16);
      }
    #else
       FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgINT16,fgINT16,flgr_defop_and_fgINT16);
    #endif
  #endif
}
void flgr1d_arith_const_and_fgINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  #ifdef __SSE2__
    if(datdest->spp==1) {
      flgr1d_arith_const_and_spp1_SSE2_fgINT32(datdest,data1,vec_const);
    }else {
      FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgINT32,fgINT32,flgr_defop_and_fgINT32);
    }
  #else
    #ifdef __SSE__
      if(datdest->spp==1) {
        flgr1d_arith_const_and_spp1_SSE_fgINT32(datdest,data1,vec_const);
      }else {
        FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgINT32,fgINT32,flgr_defop_and_fgINT32);
      }
    #else
       FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgINT32,fgINT32,flgr_defop_and_fgINT32);
    #endif
  #endif
}
void flgr1d_arith_const_and_fgFLOAT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  flgr_no_define_type_function(FLGR_FLOAT32);
}
void flgr1d_arith_const_and_fgFLOAT64(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  flgr_no_define_type_function(FLGR_FLOAT64);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute And with a constant every pixels
 *  @param datdest : pointer to FLGR_Data1D
 *  @param data1 : pointer to FLGR_Data1D
 *  @param vec_const : pointer to a Vector
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr1d_arith_const_and_ptr(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_Ret ret;

  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr1d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr1d_arith_const_and,datdest,data1,vec_const);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute And with a constant every pixels
 *  @param datdest : pointer to FLGR_Data1D
 *  @param data1 : pointer to FLGR_Data1D
 *  @param constant : string representing a constant
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr1d_arith_const_and_str(FLGR_Data1D *datdest, FLGR_Data1D *data1, char *constant) {
  int ret;
  FLGR_Vector *vector_constant;

  if((data1==NULL) || (datdest==NULL))  {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  vector_constant = flgr_vector_create(data1->spp,data1->type);

  if((ret=flgr_vector_import_string(vector_constant, constant))
     != FLGR_RET_OK) {

    POST_ERROR("String is not valid ""%s""\n",constant);
    flgr_vector_destroy(vector_constant);
    return ret;
  }



  ret = flgr1d_arith_const_and_ptr(datdest,data1,vector_constant);

  flgr_vector_destroy(vector_constant);


  return ret;

}



/*******************************************************************************
 * OR CONST
 *******************************************************************************/

void flgr1d_arith_const_or_fgBIT(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgBIT,fgBIT,flgr_defop_or_fgBIT);
}
void flgr1d_arith_const_or_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  #ifdef __SSE2__
    if(datdest->spp==1) {
      flgr1d_arith_const_or_spp1_SSE2_fgUINT8(datdest,data1,vec_const);
    }else {
      FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT8,fgUINT8,flgr_defop_or_fgUINT8);
    }
  #else
    #ifdef __SSE__
      if(datdest->spp==1) {
        flgr1d_arith_const_or_spp1_SSE_fgUINT8(datdest,data1,vec_const);
      }else {
        FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT8,fgUINT8,flgr_defop_or_fgUINT8);
      }
    #else
       FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT8,fgUINT8,flgr_defop_or_fgUINT8);
    #endif
  #endif
}
void flgr1d_arith_const_or_fgUINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  #ifdef __SSE2__
    if(datdest->spp==1) {
      flgr1d_arith_const_or_spp1_SSE2_fgUINT16(datdest,data1,vec_const);
    }else {
      FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT16,fgUINT16,flgr_defop_or_fgUINT16);
    }
  #else
    #ifdef __SSE__
      if(datdest->spp==1) {
        flgr1d_arith_const_or_spp1_SSE_fgUINT16(datdest,data1,vec_const);
      }else {
        FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT16,fgUINT16,flgr_defop_or_fgUINT16);
      }
    #else
       FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT16,fgUINT16,flgr_defop_or_fgUINT16);
    #endif
  #endif
}
void flgr1d_arith_const_or_fgUINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  #ifdef __SSE2__
    if(datdest->spp==1) {
      flgr1d_arith_const_or_spp1_SSE2_fgUINT32(datdest,data1,vec_const);
    }else {
      FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT32,fgUINT32,flgr_defop_or_fgUINT32);
    }
  #else
    #ifdef __SSE__
      if(datdest->spp==1) {
        flgr1d_arith_const_or_spp1_SSE_fgUINT32(datdest,data1,vec_const);
      }else {
        FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT32,fgUINT32,flgr_defop_or_fgUINT32);
      }
    #else
       FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT32,fgUINT32,flgr_defop_or_fgUINT32);
    #endif
  #endif
}
void flgr1d_arith_const_or_fgINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  #ifdef __SSE2__
    if(datdest->spp==1) {
      flgr1d_arith_const_or_spp1_SSE2_fgINT8(datdest,data1,vec_const);
    }else {
      FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgINT8,fgINT8,flgr_defop_or_fgINT8);
    }
  #else
    #ifdef __SSE__
      if(datdest->spp==1) {
        flgr1d_arith_const_or_spp1_SSE_fgINT8(datdest,data1,vec_const);
      }else {
        FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgINT8,fgINT8,flgr_defop_or_fgINT8);
      }
    #else
       FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgINT8,fgINT8,flgr_defop_or_fgINT8);
    #endif
  #endif
}
void flgr1d_arith_const_or_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  #ifdef __SSE2__
    if(datdest->spp==1) {
      flgr1d_arith_const_or_spp1_SSE2_fgINT16(datdest,data1,vec_const);
    }else {
      FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgINT16,fgINT16,flgr_defop_or_fgINT16);
    }
  #else
    #ifdef __SSE__
      if(datdest->spp==1) {
        flgr1d_arith_const_or_spp1_SSE_fgINT16(datdest,data1,vec_const);
      }else {
        FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgINT16,fgINT16,flgr_defop_or_fgINT16);
      }
    #else
       FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgINT16,fgINT16,flgr_defop_or_fgINT16);
    #endif
  #endif
}
void flgr1d_arith_const_or_fgINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  #ifdef __SSE2__
    if(datdest->spp==1) {
      flgr1d_arith_const_or_spp1_SSE2_fgINT32(datdest,data1,vec_const);
    }else {
      FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgINT32,fgINT32,flgr_defop_or_fgINT32);
    }
  #else
    #ifdef __SSE__
      if(datdest->spp==1) {
        flgr1d_arith_const_or_spp1_SSE_fgINT32(datdest,data1,vec_const);
      }else {
        FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgINT32,fgINT32,flgr_defop_or_fgINT32);
      }
    #else
       FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgINT32,fgINT32,flgr_defop_or_fgINT32);
    #endif
  #endif
}
void flgr1d_arith_const_or_fgFLOAT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  flgr_no_define_type_function(FLGR_FLOAT32);
}
void flgr1d_arith_const_or_fgFLOAT64(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  flgr_no_define_type_function(FLGR_FLOAT64);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Or with a constant every pixels
 *  @param datdest : pointer to FLGR_Data1D
 *  @param data1 : pointer to FLGR_Data1D
 *  @param vec_const : pointer to a Vector
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr1d_arith_const_or_ptr(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_Ret ret;

  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr1d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr1d_arith_const_or,datdest,data1,vec_const);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Or with a constant every pixels
 *  @param datdest : pointer to FLGR_Data1D
 *  @param data1 : pointer to FLGR_Data1D
 *  @param constant : string representing a constant
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr1d_arith_const_or_str(FLGR_Data1D *datdest, FLGR_Data1D *data1, char *constant) {
  int ret;
  FLGR_Vector *vector_constant;

  if((data1==NULL) || (datdest==NULL))  {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  vector_constant = flgr_vector_create(data1->spp,data1->type);

  if((ret=flgr_vector_import_string(vector_constant, constant))
     != FLGR_RET_OK) {

    POST_ERROR("String is not valid ""%s""\n",constant);
    flgr_vector_destroy(vector_constant);
    return ret;
  }



  ret = flgr1d_arith_const_or_ptr(datdest,data1,vector_constant);

  flgr_vector_destroy(vector_constant);


  return ret;

}




/*******************************************************************************
 * XOR CONST
 *******************************************************************************/

void flgr1d_arith_const_xor_fgBIT(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgBIT,fgBIT,flgr_defop_xor_fgBIT);
}
void flgr1d_arith_const_xor_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  #ifdef __SSE2__
    if(datdest->spp==1) {
      flgr1d_arith_const_xor_spp1_SSE2_fgUINT8(datdest,data1,vec_const);
    }else {
      FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT8,fgUINT8,flgr_defop_xor_fgUINT8);
    }
  #else
    #ifdef __SSE__
      if(datdest->spp==1) {
        flgr1d_arith_const_xor_spp1_SSE_fgUINT8(datdest,data1,vec_const);
      }else {
        FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT8,fgUINT8,flgr_defop_xor_fgUINT8);
      }
    #else
       FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT8,fgUINT8,flgr_defop_xor_fgUINT8);
    #endif
  #endif
}
void flgr1d_arith_const_xor_fgUINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  #ifdef __SSE2__
    if(datdest->spp==1) {
      flgr1d_arith_const_xor_spp1_SSE2_fgUINT16(datdest,data1,vec_const);
    }else {
      FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT16,fgUINT16,flgr_defop_xor_fgUINT16);
    }
  #else
    #ifdef __SSE__
      if(datdest->spp==1) {
        flgr1d_arith_const_xor_spp1_SSE_fgUINT16(datdest,data1,vec_const);
      }else {
        FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT16,fgUINT16,flgr_defop_xor_fgUINT16);
      }
    #else
       FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT16,fgUINT16,flgr_defop_xor_fgUINT16);
    #endif
  #endif
}
void flgr1d_arith_const_xor_fgUINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  #ifdef __SSE2__
    if(datdest->spp==1) {
      flgr1d_arith_const_xor_spp1_SSE2_fgUINT32(datdest,data1,vec_const);
    }else {
      FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT32,fgUINT32,flgr_defop_xor_fgUINT32);
    }
  #else
    #ifdef __SSE__
      if(datdest->spp==1) {
        flgr1d_arith_const_xor_spp1_SSE_fgUINT32(datdest,data1,vec_const);
      }else {
        FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT32,fgUINT32,flgr_defop_xor_fgUINT32);
      }
    #else
       FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT32,fgUINT32,flgr_defop_xor_fgUINT32);
    #endif
  #endif
}
void flgr1d_arith_const_xor_fgINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  #ifdef __SSE2__
    if(datdest->spp==1) {
      flgr1d_arith_const_xor_spp1_SSE2_fgINT8(datdest,data1,vec_const);
    }else {
      FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgINT8,fgINT8,flgr_defop_xor_fgINT8);
    }
  #else
    #ifdef __SSE__
      if(datdest->spp==1) {
        flgr1d_arith_const_xor_spp1_SSE_fgINT8(datdest,data1,vec_const);
      }else {
        FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgINT8,fgINT8,flgr_defop_xor_fgINT8);
      }
    #else
       FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgINT8,fgINT8,flgr_defop_xor_fgINT8);
    #endif
  #endif
}
void flgr1d_arith_const_xor_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  #ifdef __SSE2__
    if(datdest->spp==1) {
      flgr1d_arith_const_xor_spp1_SSE2_fgINT16(datdest,data1,vec_const);
    }else {
      FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgINT16,fgINT16,flgr_defop_xor_fgINT16);
    }
  #else
    #ifdef __SSE__
      if(datdest->spp==1) {
        flgr1d_arith_const_xor_spp1_SSE_fgINT16(datdest,data1,vec_const);
      }else {
        FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgINT16,fgINT16,flgr_defop_xor_fgINT16);
      }
    #else
       FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgINT16,fgINT16,flgr_defop_xor_fgINT16);
    #endif
  #endif
}
void flgr1d_arith_const_xor_fgINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  #ifdef __SSE2__
    if(datdest->spp==1) {
      flgr1d_arith_const_xor_spp1_SSE2_fgINT32(datdest,data1,vec_const);
    }else {
      FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgINT32,fgINT32,flgr_defop_xor_fgINT32);
    }
  #else
    #ifdef __SSE__
      if(datdest->spp==1) {
        flgr1d_arith_const_xor_spp1_SSE_fgINT32(datdest,data1,vec_const);
      }else {
        FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgINT32,fgINT32,flgr_defop_xor_fgINT32);
      }
    #else
       FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgINT32,fgINT32,flgr_defop_xor_fgINT32);
    #endif
  #endif
}
void flgr1d_arith_const_xor_fgFLOAT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  flgr_no_define_type_function(FLGR_FLOAT32);
}
void flgr1d_arith_const_xor_fgFLOAT64(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  flgr_no_define_type_function(FLGR_FLOAT64);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Xor with a constant every pixels
 *  @param datdest : pointer to FLGR_Data1D
 *  @param data1 : pointer to FLGR_Data1D
 *  @param vec_const : pointer to a Vector
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr1d_arith_const_xor_ptr(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_Ret ret;

  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr1d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr1d_arith_const_xor,datdest,data1,vec_const);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Xor with a constant every pixels
 *  @param datdest : pointer to FLGR_Data1D
 *  @param data1 : pointer to FLGR_Data1D
 *  @param constant : string representing a constant
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr1d_arith_const_xor_str(FLGR_Data1D *datdest, FLGR_Data1D *data1, char *constant) {
  int ret;
  FLGR_Vector *vector_constant;

  if((data1==NULL) || (datdest==NULL))  {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  vector_constant = flgr_vector_create(data1->spp,data1->type);

  if((ret=flgr_vector_import_string(vector_constant, constant))
     != FLGR_RET_OK) {

    POST_ERROR("String is not valid ""%s""\n",constant);
    flgr_vector_destroy(vector_constant);
    return ret;
  }



  ret = flgr1d_arith_const_xor_ptr(datdest,data1,vector_constant);

  flgr_vector_destroy(vector_constant);


  return ret;

}





/*******************************************************************************
 * ATAN2 CONST
 *******************************************************************************/

void flgr1d_arith_const_atan2_fgBIT(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  flgr_no_define_type_function(FLGR_BIT);
}
void flgr1d_arith_const_atan2_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  flgr_no_define_type_function(FLGR_UINT8);
}
void flgr1d_arith_const_atan2_fgUINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  flgr_no_define_type_function(FLGR_UINT16);
}
void flgr1d_arith_const_atan2_fgUINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  flgr_no_define_type_function(FLGR_UINT32);
}
void flgr1d_arith_const_atan2_fgINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  flgr_no_define_type_function(FLGR_INT8);
}
void flgr1d_arith_const_atan2_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  flgr_no_define_type_function(FLGR_INT16);
}
void flgr1d_arith_const_atan2_fgINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  flgr_no_define_type_function(FLGR_INT32);
}
void flgr1d_arith_const_atan2_fgFLOAT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgFLOAT32,fgFLOAT32,flgr_defop_atan2_fgFLOAT32);
}
void flgr1d_arith_const_atan2_fgFLOAT64(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgFLOAT64,fgFLOAT64,flgr_defop_atan2_fgFLOAT64);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Atan2 with a constant every pixels
 *  @param datdest : pointer to FLGR_Data1D
 *  @param data1 : pointer to FLGR_Data1D
 *  @param vec_const : pointer to a Vector
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr1d_arith_const_atan2_ptr(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_Ret ret;

  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr1d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr1d_arith_const_atan2,datdest,data1,vec_const);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Atan2 with a constant every pixels
 *  @param datdest : pointer to FLGR_Data1D
 *  @param data1 : pointer to FLGR_Data1D
 *  @param constant : string representing a constant
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr1d_arith_const_atan2_str(FLGR_Data1D *datdest, FLGR_Data1D *data1, char *constant) {
  int ret;
  FLGR_Vector *vector_constant;

  if((data1==NULL) || (datdest==NULL))  {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  vector_constant = flgr_vector_create(data1->spp,data1->type);

  if((ret=flgr_vector_import_string(vector_constant, constant))
     != FLGR_RET_OK) {

    POST_ERROR("String is not valid ""%s""\n",constant);
    flgr_vector_destroy(vector_constant);
    return ret;
  }



  ret = flgr1d_arith_const_atan2_ptr(datdest,data1,vector_constant);

  flgr_vector_destroy(vector_constant);


  return ret;

}






/*******************************************************************************
 * ARGUMENT CONST
 *******************************************************************************/

void flgr1d_arith_const_argument_fgBIT(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  flgr_no_define_type_function(FLGR_BIT);
}
void flgr1d_arith_const_argument_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT8,fgUINT8,flgr_defop_argument_fgUINT8);
}
void flgr1d_arith_const_argument_fgUINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT16,fgUINT16,flgr_defop_argument_fgUINT16);
}
void flgr1d_arith_const_argument_fgUINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT32,fgUINT32,flgr_defop_argument_fgUINT32);
}
void flgr1d_arith_const_argument_fgINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgINT8,fgINT8,flgr_defop_argument_fgINT8);
}
void flgr1d_arith_const_argument_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgINT16,fgINT16,flgr_defop_argument_fgINT16);
}
void flgr1d_arith_const_argument_fgINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgINT32,fgINT32,flgr_defop_argument_fgINT32);
}
void flgr1d_arith_const_argument_fgFLOAT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgFLOAT32,fgFLOAT32,flgr_defop_argument_fgFLOAT32);
}
void flgr1d_arith_const_argument_fgFLOAT64(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgFLOAT64,fgFLOAT64,flgr_defop_argument_fgFLOAT64);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Argument with a constant every pixels
 *  @param datdest : pointer to FLGR_Data1D
 *  @param data1 : pointer to FLGR_Data1D
 *  @param vec_const : pointer to a Vector
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr1d_arith_const_argument_ptr(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_Ret ret;

  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr1d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr1d_arith_const_argument,datdest,data1,vec_const);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Argument with a constant every pixels
 *  @param datdest : pointer to FLGR_Data1D
 *  @param data1 : pointer to FLGR_Data1D
 *  @param constant : string representing a constant
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr1d_arith_const_argument_str(FLGR_Data1D *datdest, FLGR_Data1D *data1, char *constant) {
  int ret;
  FLGR_Vector *vector_constant;

  if((data1==NULL) || (datdest==NULL))  {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  vector_constant = flgr_vector_create(data1->spp,data1->type);

  if((ret=flgr_vector_import_string(vector_constant, constant))
     != FLGR_RET_OK) {

    POST_ERROR("String is not valid ""%s""\n",constant);
    flgr_vector_destroy(vector_constant);
    return ret;
  }



  ret = flgr1d_arith_const_argument_ptr(datdest,data1,vector_constant);

  flgr_vector_destroy(vector_constant);


  return ret;

}







/*******************************************************************************
 * MODULE CONST
 *******************************************************************************/

void flgr1d_arith_const_module_fgBIT(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  flgr_no_define_type_function(FLGR_BIT);
}
void flgr1d_arith_const_module_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT8,fgUINT8,flgr_defop_module_fgUINT8);
}
void flgr1d_arith_const_module_fgUINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT16,fgUINT16,flgr_defop_module_fgUINT16);
}
void flgr1d_arith_const_module_fgUINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT32,fgUINT32,flgr_defop_module_fgUINT32);
}
void flgr1d_arith_const_module_fgINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgINT8,fgINT8,flgr_defop_module_fgINT8);
}
void flgr1d_arith_const_module_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgINT16,fgINT16,flgr_defop_module_fgINT16);
}
void flgr1d_arith_const_module_fgINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgINT32,fgINT32,flgr_defop_module_fgINT32);
}
void flgr1d_arith_const_module_fgFLOAT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgFLOAT32,fgFLOAT32,flgr_defop_module_fgFLOAT32);
}
void flgr1d_arith_const_module_fgFLOAT64(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgFLOAT64,fgFLOAT64,flgr_defop_module_fgFLOAT64);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Module with a constant every pixels
 *  @param datdest : pointer to FLGR_Data1D
 *  @param data1 : pointer to FLGR_Data1D
 *  @param vec_const : pointer to a Vector
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr1d_arith_const_module_ptr(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_Ret ret;

  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr1d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr1d_arith_const_module,datdest,data1,vec_const);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Module with a constant every pixels
 *  @param datdest : pointer to FLGR_Data1D
 *  @param data1 : pointer to FLGR_Data1D
 *  @param constant : string representing a constant
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr1d_arith_const_module_str(FLGR_Data1D *datdest, FLGR_Data1D *data1, char *constant) {
  int ret;
  FLGR_Vector *vector_constant;

  if((data1==NULL) || (datdest==NULL))  {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  vector_constant = flgr_vector_create(data1->spp,data1->type);

  if((ret=flgr_vector_import_string(vector_constant, constant))
     != FLGR_RET_OK) {

    POST_ERROR("String is not valid ""%s""\n",constant);
    flgr_vector_destroy(vector_constant);
    return ret;
  }



  ret = flgr1d_arith_const_module_ptr(datdest,data1,vector_constant);

  flgr_vector_destroy(vector_constant);


  return ret;

}




/*******************************************************************************
 * MULTSAT CONST
 *******************************************************************************/

void flgr1d_arith_const_multsat_fgBIT(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  flgr_no_define_type_function(FLGR_BIT);
}
void flgr1d_arith_const_multsat_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT8,fgUINT8,flgr_defop_multsat_fgUINT8);
}
void flgr1d_arith_const_multsat_fgUINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT16,fgUINT16,flgr_defop_multsat_fgUINT16);
}
void flgr1d_arith_const_multsat_fgUINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT32,fgUINT32,flgr_defop_multsat_fgUINT32);
}
void flgr1d_arith_const_multsat_fgINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgINT8,fgINT8,flgr_defop_multsat_fgINT8);
}
void flgr1d_arith_const_multsat_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgINT16,fgINT16,flgr_defop_multsat_fgINT16);
}
void flgr1d_arith_const_multsat_fgINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgINT32,fgINT32,flgr_defop_multsat_fgINT32);
}
void flgr1d_arith_const_multsat_fgFLOAT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  flgr_no_define_type_function(FLGR_FLOAT32);
}
void flgr1d_arith_const_multsat_fgFLOAT64(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  flgr_no_define_type_function(FLGR_FLOAT64);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Multsat with a constant every pixels
 *  @param datdest : pointer to FLGR_Data1D
 *  @param data1 : pointer to FLGR_Data1D
 *  @param vec_const : pointer to a Vector
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr1d_arith_const_multsat_ptr(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_Ret ret;

  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr1d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr1d_arith_const_multsat,datdest,data1,vec_const);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Multsat with a constant every pixels
 *  @param datdest : pointer to FLGR_Data1D
 *  @param data1 : pointer to FLGR_Data1D
 *  @param constant : string representing a constant
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr1d_arith_const_multsat_str(FLGR_Data1D *datdest, FLGR_Data1D *data1, char *constant) {
  int ret;
  FLGR_Vector *vector_constant;

  if((data1==NULL) || (datdest==NULL))  {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  vector_constant = flgr_vector_create(data1->spp,data1->type);

  if((ret=flgr_vector_import_string(vector_constant, constant))
     != FLGR_RET_OK) {

    POST_ERROR("String is not valid ""%s""\n",constant);
    flgr_vector_destroy(vector_constant);
    return ret;
  }

  ret = flgr1d_arith_const_multsat_ptr(datdest,data1,vector_constant);

  flgr_vector_destroy(vector_constant);


  return ret;

}




/*******************************************************************************
 * SUBSAT CONST
 *******************************************************************************/

void flgr1d_arith_const_subsat_fgBIT(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  flgr_no_define_type_function(FLGR_BIT);
}
void flgr1d_arith_const_subsat_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  #ifdef __SSE2__
    if(datdest->spp==1) {
      flgr1d_arith_const_subsat_spp1_SSE2_fgUINT8(datdest,data1,vec_const);
    }else {
      FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT8,fgUINT8,flgr_defop_subsat_fgUINT8);
    }
  #else
    #ifdef __SSE__
      if(datdest->spp==1) {
        flgr1d_arith_const_subsat_spp1_SSE_fgUINT8(datdest,data1,vec_const);
      }else {
        FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT8,fgUINT8,flgr_defop_subsat_fgUINT8);
      }
    #else
       FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT8,fgUINT8,flgr_defop_subsat_fgUINT8);
    #endif
  #endif
}
void flgr1d_arith_const_subsat_fgUINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  #ifdef __SSE2__
    if(datdest->spp==1) {
      flgr1d_arith_const_subsat_spp1_SSE2_fgUINT16(datdest,data1,vec_const);
    }else {
      FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT16,fgUINT16,flgr_defop_subsat_fgUINT16);
    }
  #else
    #ifdef __SSE__
      if(datdest->spp==1) {
        flgr1d_arith_const_subsat_spp1_SSE_fgUINT16(datdest,data1,vec_const);
      }else {
        FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT16,fgUINT16,flgr_defop_subsat_fgUINT16);
      }
    #else
       FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT16,fgUINT16,flgr_defop_subsat_fgUINT16);
    #endif
  #endif
}
void flgr1d_arith_const_subsat_fgUINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT32,fgUINT32,flgr_defop_subsat_fgUINT32);
}
void flgr1d_arith_const_subsat_fgINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgINT8,fgINT8,flgr_defop_subsat_fgINT8);
}
void flgr1d_arith_const_subsat_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  #ifdef __SSE2__
    if(datdest->spp==1) {
      flgr1d_arith_const_subsat_spp1_SSE2_fgINT16(datdest,data1,vec_const);
    }else {
      FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgINT16,fgINT16,flgr_defop_subsat_fgINT16);
    }
  #else
    #ifdef __SSE__
      if(datdest->spp==1) {
        flgr1d_arith_const_subsat_spp1_SSE_fgINT16(datdest,data1,vec_const);
      }else {
        FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgINT16,fgINT16,flgr_defop_subsat_fgINT16);
      }
    #else
       FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgINT16,fgINT16,flgr_defop_subsat_fgINT16);
    #endif
  #endif
}
void flgr1d_arith_const_subsat_fgINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgINT32,fgINT32,flgr_defop_subsat_fgINT32);
}
void flgr1d_arith_const_subsat_fgFLOAT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  flgr_no_define_type_function(FLGR_FLOAT32);
}
void flgr1d_arith_const_subsat_fgFLOAT64(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  flgr_no_define_type_function(FLGR_FLOAT64);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Subsat with a constant every pixels
 *  @param datdest : pointer to FLGR_Data1D
 *  @param data1 : pointer to FLGR_Data1D
 *  @param vec_const : pointer to a Vector
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr1d_arith_const_subsat_ptr(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_Ret ret;

  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr1d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr1d_arith_const_subsat,datdest,data1,vec_const);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Subsat with a constant every pixels
 *  @param datdest : pointer to FLGR_Data1D
 *  @param data1 : pointer to FLGR_Data1D
 *  @param constant : string representing a constant
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr1d_arith_const_subsat_str(FLGR_Data1D *datdest, FLGR_Data1D *data1, char *constant) {
  int ret;
  FLGR_Vector *vector_constant;

  if((data1==NULL) || (datdest==NULL))  {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  vector_constant = flgr_vector_create(data1->spp,data1->type);

  if((ret=flgr_vector_import_string(vector_constant, constant))
     != FLGR_RET_OK) {

    POST_ERROR("String is not valid ""%s""\n",constant);
    flgr_vector_destroy(vector_constant);
    return ret;
  }

  ret = flgr1d_arith_const_subsat_ptr(datdest,data1,vector_constant);

  flgr_vector_destroy(vector_constant);


  return ret;

}





/*******************************************************************************
 * ADDSAT CONST
 *******************************************************************************/

void flgr1d_arith_const_addsat_fgBIT(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  flgr_no_define_type_function(FLGR_BIT);
}
void flgr1d_arith_const_addsat_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  #ifdef __SSE2__
    if(datdest->spp==1) {
      flgr1d_arith_const_addsat_spp1_SSE2_fgUINT8(datdest,data1,vec_const);
    }else {
      FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT8,fgUINT8,flgr_defop_addsat_fgUINT8);
    }
  #else
    #ifdef __SSE__
      if(datdest->spp==1) {
        flgr1d_arith_const_addsat_spp1_SSE_fgUINT8(datdest,data1,vec_const);
      }else {
        FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT8,fgUINT8,flgr_defop_addsat_fgUINT8);
      }
    #else
       FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT8,fgUINT8,flgr_defop_addsat_fgUINT8);
    #endif
  #endif
}
void flgr1d_arith_const_addsat_fgUINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  #ifdef __SSE2__
    if(datdest->spp==1) {
      flgr1d_arith_const_addsat_spp1_SSE2_fgUINT16(datdest,data1,vec_const);
    }else {
      FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT16,fgUINT16,flgr_defop_addsat_fgUINT16);
    }
  #else
    #ifdef __SSE__
      if(datdest->spp==1) {
        flgr1d_arith_const_addsat_spp1_SSE_fgUINT16(datdest,data1,vec_const);
      }else {
        FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT16,fgUINT16,flgr_defop_addsat_fgUINT16);
      }
    #else
       FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT16,fgUINT16,flgr_defop_addsat_fgUINT16);
    #endif
  #endif
}
void flgr1d_arith_const_addsat_fgUINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT32,fgUINT32,flgr_defop_addsat_fgUINT32);
}
void flgr1d_arith_const_addsat_fgINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgINT8,fgINT8,flgr_defop_addsat_fgINT8);
}
void flgr1d_arith_const_addsat_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  #ifdef __SSE2__
    if(datdest->spp==1) {
      flgr1d_arith_const_addsat_spp1_SSE2_fgINT16(datdest,data1,vec_const);
    }else {
      FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgINT16,fgINT16,flgr_defop_addsat_fgINT16);
    }
  #else
    #ifdef __SSE__
      if(datdest->spp==1) {
        flgr1d_arith_const_addsat_spp1_SSE_fgINT16(datdest,data1,vec_const);
      }else {
        FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgINT16,fgINT16,flgr_defop_addsat_fgINT16);
      }
    #else
       FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgINT16,fgINT16,flgr_defop_addsat_fgINT16);
    #endif
  #endif
}
void flgr1d_arith_const_addsat_fgINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgINT32,fgINT32,flgr_defop_addsat_fgINT32);
}
void flgr1d_arith_const_addsat_fgFLOAT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  flgr_no_define_type_function(FLGR_FLOAT32);
}
void flgr1d_arith_const_addsat_fgFLOAT64(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  flgr_no_define_type_function(FLGR_FLOAT64);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Addsat with a constant every pixels
 *  @param datdest : pointer to FLGR_Data1D
 *  @param data1 : pointer to FLGR_Data1D
 *  @param vec_const : pointer to a Vector
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr1d_arith_const_addsat_ptr(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_Ret ret;

  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr1d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr1d_arith_const_addsat,datdest,data1,vec_const);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Addsat with a constant every pixels
 *  @param datdest : pointer to FLGR_Data1D
 *  @param data1 : pointer to FLGR_Data1D
 *  @param constant : string representing a constant
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr1d_arith_const_addsat_str(FLGR_Data1D *datdest, FLGR_Data1D *data1, char *constant) {
  int ret;
  FLGR_Vector *vector_constant;

  if((data1==NULL) || (datdest==NULL))  {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  vector_constant = flgr_vector_create(data1->spp,data1->type);

  if((ret=flgr_vector_import_string(vector_constant, constant))
     != FLGR_RET_OK) {

    POST_ERROR("String is not valid ""%s""\n",constant);
    flgr_vector_destroy(vector_constant);
    return ret;
  }

  ret = flgr1d_arith_const_addsat_ptr(datdest,data1,vector_constant);

  flgr_vector_destroy(vector_constant);


  return ret;

}




/*******************************************************************************
 * DIV CONST
 *******************************************************************************/

void flgr1d_arith_const_div_fgBIT(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  flgr_no_define_type_function(FLGR_BIT);
}
void flgr1d_arith_const_div_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT8,fgUINT8,flgr_defop_div_fgUINT8);
}
void flgr1d_arith_const_div_fgUINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT16,fgUINT16,flgr_defop_div_fgUINT16);
}
void flgr1d_arith_const_div_fgUINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT32,fgUINT32,flgr_defop_div_fgUINT32);
}
void flgr1d_arith_const_div_fgINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgINT8,fgINT8,flgr_defop_div_fgINT8);
}
void flgr1d_arith_const_div_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgINT16,fgINT16,flgr_defop_div_fgINT16);
}
void flgr1d_arith_const_div_fgINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgINT32,fgINT32,flgr_defop_div_fgINT32);
}
void flgr1d_arith_const_div_fgFLOAT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgFLOAT32,fgFLOAT32,flgr_defop_div_fgFLOAT32);
}
void flgr1d_arith_const_div_fgFLOAT64(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgFLOAT64,fgFLOAT64,flgr_defop_div_fgFLOAT64);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Div with a constant every pixels
 *  @param datdest : pointer to FLGR_Data1D
 *  @param data1 : pointer to FLGR_Data1D
 *  @param vec_const : pointer to a Vector
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr1d_arith_const_div_ptr(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_Ret ret;

  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr1d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr1d_arith_const_div,datdest,data1,vec_const);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Div with a constant every pixels
 *  @param datdest : pointer to FLGR_Data1D
 *  @param data1 : pointer to FLGR_Data1D
 *  @param constant : string representing a constant
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr1d_arith_const_div_str(FLGR_Data1D *datdest, FLGR_Data1D *data1, char *constant) {
  int ret;
  FLGR_Vector *vector_constant;

  if((data1==NULL) || (datdest==NULL))  {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  vector_constant = flgr_vector_create(data1->spp,data1->type);

  if((ret=flgr_vector_import_string(vector_constant, constant))
     != FLGR_RET_OK) {

    POST_ERROR("String is not valid ""%s""\n",constant);
    flgr_vector_destroy(vector_constant);
    return ret;
  }



  ret = flgr1d_arith_const_div_ptr(datdest,data1,vector_constant);

  flgr_vector_destroy(vector_constant);


  return ret;

}






/*******************************************************************************
 * MULT CONST
 *******************************************************************************/

void flgr1d_arith_const_mult_fgBIT(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  flgr_no_define_type_function(FLGR_BIT);
}
void flgr1d_arith_const_mult_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT8,fgUINT8,flgr_defop_mult_fgUINT8);
}
void flgr1d_arith_const_mult_fgUINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT16,fgUINT16,flgr_defop_mult_fgUINT16);
}
void flgr1d_arith_const_mult_fgUINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT32,fgUINT32,flgr_defop_mult_fgUINT32);
}
void flgr1d_arith_const_mult_fgINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgINT8,fgINT8,flgr_defop_mult_fgINT8);
}
void flgr1d_arith_const_mult_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgINT16,fgINT16,flgr_defop_mult_fgINT16);
}
void flgr1d_arith_const_mult_fgINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgINT32,fgINT32,flgr_defop_mult_fgINT32);
}
void flgr1d_arith_const_mult_fgFLOAT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgFLOAT32,fgFLOAT32,flgr_defop_mult_fgFLOAT32);
}
void flgr1d_arith_const_mult_fgFLOAT64(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgFLOAT64,fgFLOAT64,flgr_defop_mult_fgFLOAT64);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Mult with a constant every pixels
 *  @param datdest : pointer to FLGR_Data1D
 *  @param data1 : pointer to FLGR_Data1D
 *  @param vec_const : pointer to a Vector
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr1d_arith_const_mult_ptr(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_Ret ret;

  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr1d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr1d_arith_const_mult,datdest,data1,vec_const);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Mult with a constant every pixels
 *  @param datdest : pointer to FLGR_Data1D
 *  @param data1 : pointer to FLGR_Data1D
 *  @param constant : string representing a constant
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr1d_arith_const_mult_str(FLGR_Data1D *datdest, FLGR_Data1D *data1, char *constant) {
  int ret;
  FLGR_Vector *vector_constant;

  if((data1==NULL) || (datdest==NULL))  {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  vector_constant = flgr_vector_create(data1->spp,data1->type);

  if((ret=flgr_vector_import_string(vector_constant, constant))
     != FLGR_RET_OK) {

    POST_ERROR("String is not valid ""%s""\n",constant);
    flgr_vector_destroy(vector_constant);
    return ret;
  }



  ret = flgr1d_arith_const_mult_ptr(datdest,data1,vector_constant);

  flgr_vector_destroy(vector_constant);


  return ret;

}





/*******************************************************************************
 * SUB CONST
 *******************************************************************************/

void flgr1d_arith_const_sub_fgBIT(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  flgr_no_define_type_function(FLGR_BIT);
}
void flgr1d_arith_const_sub_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  #ifdef __SSE2__
    if(datdest->spp==1) {
      flgr1d_arith_const_sub_spp1_SSE2_fgUINT8(datdest,data1,vec_const);
    }else {
      FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT8,fgUINT8,flgr_defop_sub_a_b_fgUINT8);
    }
  #else
    #ifdef __SSE__
      if(datdest->spp==1) {
        flgr1d_arith_const_sub_spp1_SSE_fgUINT8(datdest,data1,vec_const);
      }else {
        FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT8,fgUINT8,flgr_defop_sub_a_b_fgUINT8);
      }
    #else
       FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT8,fgUINT8,flgr_defop_sub_a_b_fgUINT8);
    #endif
  #endif
}
void flgr1d_arith_const_sub_fgUINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  #ifdef __SSE2__
    if(datdest->spp==1) {
      flgr1d_arith_const_sub_spp1_SSE2_fgUINT16(datdest,data1,vec_const);
    }else {
      FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT16,fgUINT16,flgr_defop_sub_a_b_fgUINT16);
    }
  #else
    #ifdef __SSE__
      if(datdest->spp==1) {
        flgr1d_arith_const_sub_spp1_SSE_fgUINT16(datdest,data1,vec_const);
      }else {
        FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT16,fgUINT16,flgr_defop_sub_a_b_fgUINT16);
      }
    #else
       FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT16,fgUINT16,flgr_defop_sub_a_b_fgUINT16);
    #endif
  #endif
}
void flgr1d_arith_const_sub_fgUINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT32,fgUINT32,flgr_defop_sub_a_b_fgUINT32);
}
void flgr1d_arith_const_sub_fgINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  #ifdef __SSE2__
    if(datdest->spp==1) {
      flgr1d_arith_const_sub_spp1_SSE2_fgINT8(datdest,data1,vec_const);
    }else {
      FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgINT8,fgINT8,flgr_defop_sub_a_b_fgINT8);
    }
  #else
    #ifdef __SSE__
      if(datdest->spp==1) {
        flgr1d_arith_const_sub_spp1_SSE_fgINT8(datdest,data1,vec_const);
      }else {
        FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgINT8,fgINT8,flgr_defop_sub_a_b_fgINT8);
      }
    #else
       FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgINT8,fgINT8,flgr_defop_sub_a_b_fgINT8);
    #endif
  #endif
}
void flgr1d_arith_const_sub_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  #ifdef __SSE2__
    if(datdest->spp==1) {
      flgr1d_arith_const_sub_spp1_SSE2_fgINT16(datdest,data1,vec_const);
    }else {
      FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgINT16,fgINT16,flgr_defop_sub_a_b_fgINT16);
    }
  #else
    #ifdef __SSE__
      if(datdest->spp==1) {
        flgr1d_arith_const_sub_spp1_SSE_fgINT16(datdest,data1,vec_const);
      }else {
        FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgINT16,fgINT16,flgr_defop_sub_a_b_fgINT16);
      }
    #else
       FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgINT16,fgINT16,flgr_defop_sub_a_b_fgINT16);
    #endif
  #endif
}
void flgr1d_arith_const_sub_fgINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgINT32,fgINT32,flgr_defop_sub_a_b_fgINT32);
}
void flgr1d_arith_const_sub_fgFLOAT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgFLOAT32,fgFLOAT32,flgr_defop_sub_a_b_fgFLOAT32);
}
void flgr1d_arith_const_sub_fgFLOAT64(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgFLOAT64,fgFLOAT64,flgr_defop_sub_a_b_fgFLOAT64);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Sub with a constant every pixels
 *  @param datdest : pointer to FLGR_Data1D
 *  @param data1 : pointer to FLGR_Data1D
 *  @param vec_const : pointer to a Vector
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr1d_arith_const_sub_ptr(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_Ret ret;

  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr1d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr1d_arith_const_sub,datdest,data1,vec_const);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Sub with a constant every pixels
 *  @param datdest : pointer to FLGR_Data1D
 *  @param data1 : pointer to FLGR_Data1D
 *  @param constant : string representing a constant
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr1d_arith_const_sub_str(FLGR_Data1D *datdest, FLGR_Data1D *data1, char *constant) {
  int ret;
  FLGR_Vector *vector_constant;

  if((data1==NULL) || (datdest==NULL))  {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  vector_constant = flgr_vector_create(data1->spp,data1->type);

  if((ret=flgr_vector_import_string(vector_constant, constant))
     != FLGR_RET_OK) {

    POST_ERROR("String is not valid ""%s""\n",constant);
    flgr_vector_destroy(vector_constant);
    return ret;
  }


  ret = flgr1d_arith_const_sub_ptr(datdest,data1,vector_constant);

  flgr_vector_destroy(vector_constant);


  return ret;

}







/*******************************************************************************
 * ADD CONST
 *******************************************************************************/

void flgr1d_arith_const_add_fgBIT(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  flgr_no_define_type_function(FLGR_BIT);
}
void flgr1d_arith_const_add_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  #ifdef __SSE2__
    if(datdest->spp==1) {
      flgr1d_arith_const_add_spp1_SSE2_fgUINT8(datdest,data1,vec_const);
    }else {
      FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT8,fgUINT8,flgr_defop_add_fgUINT8);
    }
  #else
    #ifdef __SSE__
      if(datdest->spp==1) {
        flgr1d_arith_const_add_spp1_SSE_fgUINT8(datdest,data1,vec_const);
      }else {
        FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT8,fgUINT8,flgr_defop_add_fgUINT8);
      }
    #else
       FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT8,fgUINT8,flgr_defop_add_fgUINT8);
    #endif
  #endif
}
void flgr1d_arith_const_add_fgUINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  #ifdef __SSE2__
    if(datdest->spp==1) {
      flgr1d_arith_const_add_spp1_SSE2_fgUINT16(datdest,data1,vec_const);
    }else {
      FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT16,fgUINT16,flgr_defop_add_fgUINT16);
    }
  #else
    #ifdef __SSE__
      if(datdest->spp==1) {
        flgr1d_arith_const_add_spp1_SSE_fgUINT16(datdest,data1,vec_const);
      }else {
        FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT16,fgUINT16,flgr_defop_add_fgUINT16);
      }
    #else
       FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT16,fgUINT16,flgr_defop_add_fgUINT16);
    #endif
  #endif
}
void flgr1d_arith_const_add_fgUINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT32,fgUINT32,flgr_defop_add_fgUINT32);
}
void flgr1d_arith_const_add_fgINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  #ifdef __SSE2__
    if(datdest->spp==1) {
      flgr1d_arith_const_add_spp1_SSE2_fgINT8(datdest,data1,vec_const);
    }else {
      FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgINT8,fgINT8,flgr_defop_add_fgINT8);
    }
  #else
    #ifdef __SSE__
      if(datdest->spp==1) {
        flgr1d_arith_const_add_spp1_SSE_fgINT8(datdest,data1,vec_const);
      }else {
        FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgINT8,fgINT8,flgr_defop_add_fgINT8);
      }
    #else
       FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgINT8,fgINT8,flgr_defop_add_fgINT8);
    #endif
  #endif
}
void flgr1d_arith_const_add_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  #ifdef __SSE2__
    if(datdest->spp==1) {
      flgr1d_arith_const_add_spp1_SSE2_fgINT16(datdest,data1,vec_const);
    }else {
      FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgINT16,fgINT16,flgr_defop_add_fgINT16);
    }
  #else
    #ifdef __SSE__
      if(datdest->spp==1) {
        flgr1d_arith_const_add_spp1_SSE_fgINT16(datdest,data1,vec_const);
      }else {
        FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgINT16,fgINT16,flgr_defop_add_fgINT16);
      }
    #else
       FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgINT16,fgINT16,flgr_defop_add_fgINT16);
    #endif
  #endif
}
void flgr1d_arith_const_add_fgINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgINT32,fgINT32,flgr_defop_add_fgINT32);
}
void flgr1d_arith_const_add_fgFLOAT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgFLOAT32,fgFLOAT32,flgr_defop_add_fgFLOAT32);
}
void flgr1d_arith_const_add_fgFLOAT64(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgFLOAT64,fgFLOAT64,flgr_defop_add_fgFLOAT64);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Add with a constant every pixels
 *  @param datdest : pointer to FLGR_Data1D
 *  @param data1 : pointer to FLGR_Data1D
 *  @param vec_const : pointer to a Vector
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr1d_arith_const_add_ptr(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_Ret ret;

  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr1d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr1d_arith_const_add,datdest,data1,vec_const);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Add with a constant every pixels
 *  @param datdest : pointer to FLGR_Data1D
 *  @param data1 : pointer to FLGR_Data1D
 *  @param constant : string representing a constant
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr1d_arith_const_add_str(FLGR_Data1D *datdest, FLGR_Data1D *data1, char *constant) {
  int ret;
  FLGR_Vector *vector_constant;

  if((data1==NULL) || (datdest==NULL))  {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  vector_constant = flgr_vector_create(data1->spp,data1->type);

  if((ret=flgr_vector_import_string(vector_constant, constant))
     != FLGR_RET_OK) {

    POST_ERROR("String is not valid ""%s""\n",constant);
    flgr_vector_destroy(vector_constant);
    return ret;
  }


  ret = flgr1d_arith_const_add_ptr(datdest,data1,vector_constant);

  flgr_vector_destroy(vector_constant);


  return ret;

}

//! @}

/*!
 * \defgroup group_fulguro_arith_oneimg Monoadic
 * \ingroup group_fulguro_arith
 * @{
 */


/*******************************************************************************
 * Log base b
 *******************************************************************************/

void flgr1d_arith_logb_fgBIT(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  flgr_no_define_type_function(FLGR_BIT);
}
void flgr1d_arith_logb_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT8,fgUINT8,flgr_defop_logb_fgUINT8);
}

void flgr1d_arith_logb_fgUINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT16,fgUINT16,flgr_defop_logb_fgUINT16);
}

void flgr1d_arith_logb_fgUINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT32,fgUINT32,flgr_defop_logb_fgUINT32);
}

void flgr1d_arith_logb_fgINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgINT8,fgINT8,flgr_defop_logb_fgINT8);
}

void flgr1d_arith_logb_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgINT16,fgINT16,flgr_defop_logb_fgINT16);
}

void flgr1d_arith_logb_fgINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgINT32,fgINT32,flgr_defop_logb_fgINT32) ;
}

void flgr1d_arith_logb_fgFLOAT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgFLOAT32,fgFLOAT32,flgr_defop_logb_fgFLOAT32) ;
}

void flgr1d_arith_logb_fgFLOAT64(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgFLOAT64,fgFLOAT64,flgr_defop_logb_fgFLOAT64) ;
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Log on pixels
 *  @param datdest : pointer to FLGR_Data1D
 *  @param data1 : pointer to FLGR_Data1D
 *  @param base : base of the log
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr1d_arith_logb(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *base) {
  FLGR_Ret ret;

  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr1d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr1d_arith_logb,datdest,data1,base);
}





/*******************************************************************************
 * Pow base b
 *******************************************************************************/

void flgr1d_arith_powb_fgBIT(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  flgr_no_define_type_function(FLGR_BIT);
}
void flgr1d_arith_powb_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT8,fgUINT8,flgr_defop_powb_fgUINT8);
}

void flgr1d_arith_powb_fgUINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT16,fgUINT16,flgr_defop_powb_fgUINT16);
}

void flgr1d_arith_powb_fgUINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgUINT32,fgUINT32,flgr_defop_powb_fgUINT32);
}

void flgr1d_arith_powb_fgINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgINT8,fgINT8,flgr_defop_powb_fgINT8);
}

void flgr1d_arith_powb_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgINT16,fgINT16,flgr_defop_powb_fgINT16);
}

void flgr1d_arith_powb_fgINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgINT32,fgINT32,flgr_defop_powb_fgINT32) ;
}

void flgr1d_arith_powb_fgFLOAT32(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgFLOAT32,fgFLOAT32,flgr_defop_powb_fgFLOAT32) ;
}

void flgr1d_arith_powb_fgFLOAT64(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_1D_DIADIC_CONST(fgFLOAT64,fgFLOAT64,flgr_defop_powb_fgFLOAT64) ;
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Pow on pixels
 *  @param datdest : pointer to FLGR_Data1D
 *  @param data1 : pointer to FLGR_Data1D
 *  @param base : base of the pow
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr1d_arith_powb(FLGR_Data1D *datdest, FLGR_Data1D *data1, FLGR_Vector *base) {
  FLGR_Ret ret;

  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr1d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr1d_arith_powb,datdest,data1,base);
}




/*******************************************************************************
 *******************************************************************************
 *******************************************************************************
 * MONO OPERATIONS
 *******************************************************************************
 *******************************************************************************
 *******************************************************************************/



/*******************************************************************************
 * INVERT
 *******************************************************************************/

void flgr1d_arith_invert_fgBIT(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  flgr_no_define_type_function(FLGR_BIT);
}
void flgr1d_arith_invert_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  FLGR_MACRO_ARITH_1D_MONOADIC(fgUINT8,fgUINT8,flgr_defop_invert_fgUINT8);
}

void flgr1d_arith_invert_fgUINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  FLGR_MACRO_ARITH_1D_MONOADIC(fgUINT16,fgUINT16,flgr_defop_invert_fgUINT16);
}

void flgr1d_arith_invert_fgUINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  FLGR_MACRO_ARITH_1D_MONOADIC(fgUINT32,fgUINT32,flgr_defop_invert_fgUINT32);
}

void flgr1d_arith_invert_fgINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  FLGR_MACRO_ARITH_1D_MONOADIC(fgINT8,fgINT8,flgr_defop_invert_fgINT8);
}

void flgr1d_arith_invert_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  FLGR_MACRO_ARITH_1D_MONOADIC(fgINT16,fgINT16,flgr_defop_invert_fgINT16);
}

void flgr1d_arith_invert_fgINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  FLGR_MACRO_ARITH_1D_MONOADIC(fgINT32,fgINT32,flgr_defop_invert_fgINT32);
}

void flgr1d_arith_invert_fgFLOAT32(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  FLGR_MACRO_ARITH_1D_MONOADIC(fgFLOAT32,fgFLOAT32,flgr_defop_invert_fgFLOAT32);
}

void flgr1d_arith_invert_fgFLOAT64(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  FLGR_MACRO_ARITH_1D_MONOADIC(fgFLOAT64,fgFLOAT64,flgr_defop_invert_fgFLOAT64);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Invert all pixels
 *  @param datdest : pointer to FLGR_Data1D
 *  @param data1 : pointer to FLGR_Data1D
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr1d_arith_invert(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  FLGR_Ret ret;

  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr1d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr1d_arith_invert,datdest,data1);

}



/*******************************************************************************
 * ABS
 *******************************************************************************/

void flgr1d_arith_abs_fgBIT(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  flgr_no_define_type_function(FLGR_BIT);
}
void flgr1d_arith_abs_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  flgr_no_define_type_function(FLGR_UINT8);
}

void flgr1d_arith_abs_fgUINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  flgr_no_define_type_function(FLGR_UINT16);
}

void flgr1d_arith_abs_fgUINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  flgr_no_define_type_function(FLGR_UINT32);
}

void flgr1d_arith_abs_fgINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  FLGR_MACRO_ARITH_1D_MONOADIC(fgINT8,fgINT8,flgr_defop_abs_fgINT8);
}

void flgr1d_arith_abs_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  FLGR_MACRO_ARITH_1D_MONOADIC(fgINT16,fgINT16,flgr_defop_abs_fgINT16);
}

void flgr1d_arith_abs_fgINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  FLGR_MACRO_ARITH_1D_MONOADIC(fgINT32,fgINT32,flgr_defop_abs_fgINT32);
}

void flgr1d_arith_abs_fgFLOAT32(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  FLGR_MACRO_ARITH_1D_MONOADIC(fgFLOAT32,fgFLOAT32,flgr_defop_abs_fgFLOAT32);
}

void flgr1d_arith_abs_fgFLOAT64(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  FLGR_MACRO_ARITH_1D_MONOADIC(fgFLOAT64,fgFLOAT64,flgr_defop_abs_fgFLOAT64);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Absolute values on all pixels
 *  @param datdest : pointer to FLGR_Data1D
 *  @param data1 : pointer to FLGR_Data1D
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr1d_arith_abs(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  FLGR_Ret ret;

  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr1d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr1d_arith_abs,datdest,data1);

}



/*******************************************************************************
 * COS
 *******************************************************************************/

void flgr1d_arith_cos_fgBIT(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  flgr_no_define_type_function(FLGR_BIT);
}
void flgr1d_arith_cos_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  flgr_no_define_type_function(FLGR_UINT8);
}

void flgr1d_arith_cos_fgUINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  flgr_no_define_type_function(FLGR_UINT16);
}

void flgr1d_arith_cos_fgUINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  flgr_no_define_type_function(FLGR_UINT32);
}

void flgr1d_arith_cos_fgINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  flgr_no_define_type_function(FLGR_INT8);
}

void flgr1d_arith_cos_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  flgr_no_define_type_function(FLGR_INT16);
}

void flgr1d_arith_cos_fgINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  flgr_no_define_type_function(FLGR_INT32);
}

void flgr1d_arith_cos_fgFLOAT32(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  FLGR_MACRO_ARITH_1D_MONOADIC(fgFLOAT32,fgFLOAT32,flgr_defop_cos_fgFLOAT32);
}

void flgr1d_arith_cos_fgFLOAT64(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  FLGR_MACRO_ARITH_1D_MONOADIC(fgFLOAT64,fgFLOAT64,flgr_defop_cos_fgFLOAT64);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Cosine on all pixels
 *  @param datdest : pointer to FLGR_Data1D
 *  @param data1 : pointer to FLGR_Data1D
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr1d_arith_cos(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  FLGR_Ret ret;

  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr1d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr1d_arith_cos,datdest,data1);

}

/*******************************************************************************
 * SIN
 *******************************************************************************/

void flgr1d_arith_sin_fgBIT(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  flgr_no_define_type_function(FLGR_BIT);
}
void flgr1d_arith_sin_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  flgr_no_define_type_function(FLGR_UINT8);
}

void flgr1d_arith_sin_fgUINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  flgr_no_define_type_function(FLGR_UINT16);
}

void flgr1d_arith_sin_fgUINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  flgr_no_define_type_function(FLGR_UINT32);
}

void flgr1d_arith_sin_fgINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  flgr_no_define_type_function(FLGR_INT8);
}

void flgr1d_arith_sin_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  flgr_no_define_type_function(FLGR_INT16);
}

void flgr1d_arith_sin_fgINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  flgr_no_define_type_function(FLGR_INT32);
}

void flgr1d_arith_sin_fgFLOAT32(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  FLGR_MACRO_ARITH_1D_MONOADIC(fgFLOAT32,fgFLOAT32,flgr_defop_sin_fgFLOAT32);
}

void flgr1d_arith_sin_fgFLOAT64(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  FLGR_MACRO_ARITH_1D_MONOADIC(fgFLOAT64,fgFLOAT64,flgr_defop_sin_fgFLOAT64);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Sine on all pixels
 *  @param datdest : pointer to FLGR_Data1D
 *  @param data1 : pointer to FLGR_Data1D
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr1d_arith_sin(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  FLGR_Ret ret;

  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr1d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr1d_arith_sin,datdest,data1);

}

/*******************************************************************************
 * TAN
 *******************************************************************************/

void flgr1d_arith_tan_fgBIT(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  flgr_no_define_type_function(FLGR_BIT);
}
void flgr1d_arith_tan_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  flgr_no_define_type_function(FLGR_UINT8);
}

void flgr1d_arith_tan_fgUINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  flgr_no_define_type_function(FLGR_UINT16);
}

void flgr1d_arith_tan_fgUINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  flgr_no_define_type_function(FLGR_UINT32);
}

void flgr1d_arith_tan_fgINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  flgr_no_define_type_function(FLGR_INT8);
}

void flgr1d_arith_tan_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  flgr_no_define_type_function(FLGR_INT16);
}

void flgr1d_arith_tan_fgINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  flgr_no_define_type_function(FLGR_INT32);
}

void flgr1d_arith_tan_fgFLOAT32(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  FLGR_MACRO_ARITH_1D_MONOADIC(fgFLOAT32,fgFLOAT32,flgr_defop_tan_fgFLOAT32);
}

void flgr1d_arith_tan_fgFLOAT64(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  FLGR_MACRO_ARITH_1D_MONOADIC(fgFLOAT64,fgFLOAT64,flgr_defop_tan_fgFLOAT64);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Tangent on all pixels
 *  @param datdest : pointer to FLGR_Data1D
 *  @param data1 : pointer to FLGR_Data1D
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr1d_arith_tan(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  FLGR_Ret ret;

  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr1d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr1d_arith_tan,datdest,data1);

}

/*******************************************************************************
 * ACOS
 *******************************************************************************/

void flgr1d_arith_acos_fgBIT(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  flgr_no_define_type_function(FLGR_BIT);
}
void flgr1d_arith_acos_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  flgr_no_define_type_function(FLGR_UINT8);
}

void flgr1d_arith_acos_fgUINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  flgr_no_define_type_function(FLGR_UINT16);
}

void flgr1d_arith_acos_fgUINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  flgr_no_define_type_function(FLGR_UINT32);
}

void flgr1d_arith_acos_fgINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  flgr_no_define_type_function(FLGR_INT8);
}

void flgr1d_arith_acos_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  flgr_no_define_type_function(FLGR_INT16);
}

void flgr1d_arith_acos_fgINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  flgr_no_define_type_function(FLGR_INT32);
}

void flgr1d_arith_acos_fgFLOAT32(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  FLGR_MACRO_ARITH_1D_MONOADIC(fgFLOAT32,fgFLOAT32,flgr_defop_acos_fgFLOAT32);
}

void flgr1d_arith_acos_fgFLOAT64(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  FLGR_MACRO_ARITH_1D_MONOADIC(fgFLOAT64,fgFLOAT64,flgr_defop_acos_fgFLOAT64);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute arc cosine on all pixels
 *  @param datdest : pointer to FLGR_Data1D
 *  @param data1 : pointer to FLGR_Data1D
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr1d_arith_acos(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  FLGR_Ret ret;

  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr1d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr1d_arith_acos,datdest,data1);

}

/*******************************************************************************
 * ASIN
 *******************************************************************************/

void flgr1d_arith_asin_fgBIT(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  flgr_no_define_type_function(FLGR_BIT);
}
void flgr1d_arith_asin_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  flgr_no_define_type_function(FLGR_UINT8);
}

void flgr1d_arith_asin_fgUINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  flgr_no_define_type_function(FLGR_UINT16);
}

void flgr1d_arith_asin_fgUINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  flgr_no_define_type_function(FLGR_UINT32);
}

void flgr1d_arith_asin_fgINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  flgr_no_define_type_function(FLGR_INT8);
}

void flgr1d_arith_asin_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  flgr_no_define_type_function(FLGR_INT16);
}

void flgr1d_arith_asin_fgINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  flgr_no_define_type_function(FLGR_INT32);
}

void flgr1d_arith_asin_fgFLOAT32(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  FLGR_MACRO_ARITH_1D_MONOADIC(fgFLOAT32,fgFLOAT32,flgr_defop_asin_fgFLOAT32);
}

void flgr1d_arith_asin_fgFLOAT64(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  FLGR_MACRO_ARITH_1D_MONOADIC(fgFLOAT64,fgFLOAT64,flgr_defop_asin_fgFLOAT64);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute arcsine on all pixels
 *  @param datdest : pointer to FLGR_Data1D
 *  @param data1 : pointer to FLGR_Data1D
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr1d_arith_asin(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  FLGR_Ret ret;

  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr1d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr1d_arith_asin,datdest,data1);

}

/*******************************************************************************
 * ATAN
 *******************************************************************************/

void flgr1d_arith_atan_fgBIT(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  flgr_no_define_type_function(FLGR_BIT);
}
void flgr1d_arith_atan_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  flgr_no_define_type_function(FLGR_UINT8);
}

void flgr1d_arith_atan_fgUINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  flgr_no_define_type_function(FLGR_UINT16);
}

void flgr1d_arith_atan_fgUINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  flgr_no_define_type_function(FLGR_UINT32);
}

void flgr1d_arith_atan_fgINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  flgr_no_define_type_function(FLGR_INT8);
}

void flgr1d_arith_atan_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  flgr_no_define_type_function(FLGR_INT16);
}

void flgr1d_arith_atan_fgINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  flgr_no_define_type_function(FLGR_INT32);
}

void flgr1d_arith_atan_fgFLOAT32(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  FLGR_MACRO_ARITH_1D_MONOADIC(fgFLOAT32,fgFLOAT32,flgr_defop_atan_fgFLOAT32);
}

void flgr1d_arith_atan_fgFLOAT64(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  FLGR_MACRO_ARITH_1D_MONOADIC(fgFLOAT64,fgFLOAT64,flgr_defop_atan_fgFLOAT64);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Arc-Tangent on all pixels
 *  @param datdest : pointer to FLGR_Data1D
 *  @param data1 : pointer to FLGR_Data1D
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr1d_arith_atan(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  FLGR_Ret ret;

  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr1d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr1d_arith_atan,datdest,data1);

}




/*******************************************************************************
 * FLOOR
 *******************************************************************************/

void flgr1d_arith_floor_fgBIT(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  flgr_no_define_type_function(FLGR_BIT);
}
void flgr1d_arith_floor_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  flgr_no_define_type_function(FLGR_UINT8);
}

void flgr1d_arith_floor_fgUINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  flgr_no_define_type_function(FLGR_UINT16);
}

void flgr1d_arith_floor_fgUINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  flgr_no_define_type_function(FLGR_UINT32);
}

void flgr1d_arith_floor_fgINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  flgr_no_define_type_function(FLGR_INT8);
}

void flgr1d_arith_floor_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  flgr_no_define_type_function(FLGR_INT16);
}

void flgr1d_arith_floor_fgINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  flgr_no_define_type_function(FLGR_INT32);
}

void flgr1d_arith_floor_fgFLOAT32(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  FLGR_MACRO_ARITH_1D_MONOADIC(fgFLOAT32,fgFLOAT32,flgr_defop_floor_fgFLOAT32);
}

void flgr1d_arith_floor_fgFLOAT64(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  FLGR_MACRO_ARITH_1D_MONOADIC(fgFLOAT64,fgFLOAT64,flgr_defop_floor_fgFLOAT64);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Arc-Tangent on all pixels
 *  @param datdest : pointer to FLGR_Data1D
 *  @param data1 : pointer to FLGR_Data1D
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr1d_arith_floor(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  FLGR_Ret ret;

  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr1d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr1d_arith_floor,datdest,data1);

}




/*******************************************************************************
 * CEIL
 *******************************************************************************/

void flgr1d_arith_ceil_fgBIT(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  flgr_no_define_type_function(FLGR_BIT);
}
void flgr1d_arith_ceil_fgUINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  flgr_no_define_type_function(FLGR_UINT8);
}

void flgr1d_arith_ceil_fgUINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  flgr_no_define_type_function(FLGR_UINT16);
}

void flgr1d_arith_ceil_fgUINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  flgr_no_define_type_function(FLGR_UINT32);
}

void flgr1d_arith_ceil_fgINT8(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  flgr_no_define_type_function(FLGR_INT8);
}

void flgr1d_arith_ceil_fgINT16(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  flgr_no_define_type_function(FLGR_INT16);
}

void flgr1d_arith_ceil_fgINT32(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  flgr_no_define_type_function(FLGR_INT32);
}

void flgr1d_arith_ceil_fgFLOAT32(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  FLGR_MACRO_ARITH_1D_MONOADIC(fgFLOAT32,fgFLOAT32,flgr_defop_ceil_fgFLOAT32);
}

void flgr1d_arith_ceil_fgFLOAT64(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  FLGR_MACRO_ARITH_1D_MONOADIC(fgFLOAT64,fgFLOAT64,flgr_defop_ceil_fgFLOAT64);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Arc-Tangent on all pixels
 *  @param datdest : pointer to FLGR_Data1D
 *  @param data1 : pointer to FLGR_Data1D
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr1d_arith_ceil(FLGR_Data1D *datdest, FLGR_Data1D *data1) {
  FLGR_Ret ret;

  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr1d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr1d_arith_ceil,datdest,data1);

}













/****************************************************************************************************/
/****************************************************************************************************/
/****************************************************************************************************/
/****************************************** 2D Functions ********************************************/
/****************************************************************************************************/
/****************************************************************************************************/
/****************************************************************************************************/



/*******************************************************************************
 *******************************************************************************
 *******************************************************************************
 * MACRO
 *******************************************************************************
 *******************************************************************************
 *******************************************************************************/

#define FLGR_MACRO_ARITH_2D_DIADIC(fct,dtype)				\
  FLGR_Data1D **pdest = datdest->row;					\
  FLGR_Data1D **p1 = data1->row;					\
  FLGR_Data1D **p2 = data2->row;					\
  int i;								\
									\
  FLGR_DECLARE_FUNCTION;						\
									\
  for(i=0 ; i<data1->size_y ; i++,pdest++,p1++,p2++) {			\
    fct##_##dtype(*pdest,*p1,*p2);					\
  }									\
  return

#define FLGR_MACRO_ARITH_2D_DIADIC_CONST(fct,dtype)			\
  FLGR_Data1D **pdest = datdest->row;					\
  FLGR_Data1D **p1 = data1->row;					\
  int i;								\
									\
  FLGR_DECLARE_FUNCTION;						\
									\
  for(i=0 ; i<data1->size_y ; i++,pdest++,p1++) {			\
    fct##_##dtype(*pdest,*p1,vec_const);				\
  }									\
  return

#define FLGR_MACRO_ARITH_2D_MONOADIC(fct,dtype)				\
  FLGR_Data1D **pdest = datdest->row;					\
  FLGR_Data1D **p1 = data1->row;					\
  int i;								\
									\
  FLGR_DECLARE_FUNCTION;						\
									\
  for(i=0 ; i<data1->size_y ; i++,pdest++,p1++) {			\
    fct##_##dtype(*pdest,*p1);						\
  }									\
  return

#define FLGR_MACRO_ARITH_2D_MONOADIC_PARAM(fct,dtype,param)		\
  FLGR_Data1D **pdest = datdest->row;					\
  FLGR_Data1D **p1 = data1->row;					\
  int i;								\
									\
  FLGR_DECLARE_FUNCTION;						\
									\
  for(i=0 ; i<data1->size_y ; i++,pdest++,p1++) {			\
    fct##_##dtype(*pdest,*p1,param);					\
  }									\
  return

/*******************************************************************************
 *******************************************************************************
 *******************************************************************************
 * DIADIC OPERATIONS
 *******************************************************************************
 *******************************************************************************
 *******************************************************************************/

//! @}

/*!
 * \addtogroup group_fulguro_arith_twoimg
 * @{
 */



/*******************************************************************************
 * INF
 *******************************************************************************/

void flgr2d_arith_inf_fgBIT(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_inf,fgBIT);
}
void flgr2d_arith_inf_fgUINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_inf,fgUINT8);
}
void flgr2d_arith_inf_fgUINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_inf,fgUINT16);
}
void flgr2d_arith_inf_fgUINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_inf,fgUINT32);
}
void flgr2d_arith_inf_fgINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_inf,fgINT8);
}
void flgr2d_arith_inf_fgINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_inf,fgINT16);
}
void flgr2d_arith_inf_fgINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_inf,fgINT32);
}
void flgr2d_arith_inf_fgFLOAT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_inf,fgFLOAT32);
}
void flgr2d_arith_inf_fgFLOAT64(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_inf,fgFLOAT64);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Inf element by element over two FLGR_Data2D
 *  @param datdest : pointer to FLGR_Data2D
 *  @param data1 : pointer to FLGR_Data2D
 *  @param data2 : pointer to FLGR_Data2D
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr2d_arith_inf(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_Ret ret;

  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL) || (data2==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr2d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;
  if((ret = flgr2d_is_data_same_attributes(data2,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr2d_arith_inf,datdest,data1,data2);

}


/*******************************************************************************
 * SUP
 *******************************************************************************/

void flgr2d_arith_sup_fgBIT(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_sup,fgBIT);
}
void flgr2d_arith_sup_fgUINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_sup,fgUINT8);
}
void flgr2d_arith_sup_fgUINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_sup,fgUINT16);
}
void flgr2d_arith_sup_fgUINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_sup,fgUINT32);
}
void flgr2d_arith_sup_fgINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_sup,fgINT8);
}
void flgr2d_arith_sup_fgINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_sup,fgINT16);
}
void flgr2d_arith_sup_fgINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_sup,fgINT32);
}
void flgr2d_arith_sup_fgFLOAT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_sup,fgFLOAT32);
}
void flgr2d_arith_sup_fgFLOAT64(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_sup,fgFLOAT64);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Sup element by element over two FLGR_Data2D
 *  @param datdest : pointer to FLGR_Data2D
 *  @param data1 : pointer to FLGR_Data2D
 *  @param data2 : pointer to FLGR_Data2D
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr2d_arith_sup(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_Ret ret;

  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL) || (data2==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr2d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;
  if((ret = flgr2d_is_data_same_attributes(data2,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr2d_arith_sup,datdest,data1,data2);

}

/*******************************************************************************
 * AND
 *******************************************************************************/

void flgr2d_arith_and_fgBIT(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_and,fgBIT);
}
void flgr2d_arith_and_fgUINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_and,fgUINT8);
}
void flgr2d_arith_and_fgUINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_and,fgUINT16);
}
void flgr2d_arith_and_fgUINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_and,fgUINT32);
}
void flgr2d_arith_and_fgINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_and,fgINT8);
}
void flgr2d_arith_and_fgINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_and,fgINT16);
}
void flgr2d_arith_and_fgINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_and,fgINT32);
}
void flgr2d_arith_and_fgFLOAT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  flgr_no_define_type_function(FLGR_FLOAT32);
}
void flgr2d_arith_and_fgFLOAT64(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  flgr_no_define_type_function(FLGR_FLOAT64);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute And element by element over two FLGR_Data2D
 *  @param datdest : pointer to FLGR_Data2D
 *  @param data1 : pointer to FLGR_Data2D
 *  @param data2 : pointer to FLGR_Data2D
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr2d_arith_and(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_Ret ret;

  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL) || (data2==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr2d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;
  if((ret = flgr2d_is_data_same_attributes(data2,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr2d_arith_and,datdest,data1,data2);

}


/*******************************************************************************
 * OR
 *******************************************************************************/

void flgr2d_arith_or_fgBIT(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_or,fgBIT);
}
void flgr2d_arith_or_fgUINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_or,fgUINT8);
}
void flgr2d_arith_or_fgUINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_or,fgUINT16);
}
void flgr2d_arith_or_fgUINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_or,fgUINT32);
}
void flgr2d_arith_or_fgINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_or,fgINT8);
}
void flgr2d_arith_or_fgINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_or,fgINT16);
}
void flgr2d_arith_or_fgINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_or,fgINT32);
}
void flgr2d_arith_or_fgFLOAT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  flgr_no_define_type_function(FLGR_FLOAT32);
}
void flgr2d_arith_or_fgFLOAT64(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  flgr_no_define_type_function(FLGR_FLOAT64);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Or element by element over two FLGR_Data2D
 *  @param datdest : pointer to FLGR_Data2D
 *  @param data1 : pointer to FLGR_Data2D
 *  @param data2 : pointer to FLGR_Data2D
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr2d_arith_or(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_Ret ret;

  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL) || (data2==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr2d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;
  if((ret = flgr2d_is_data_same_attributes(data2,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr2d_arith_or,datdest,data1,data2);

}


/*******************************************************************************
 * XOR
 *******************************************************************************/

void flgr2d_arith_xor_fgBIT(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_xor,fgBIT);
}
void flgr2d_arith_xor_fgUINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_xor,fgUINT8);
}
void flgr2d_arith_xor_fgUINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_xor,fgUINT16);
}
void flgr2d_arith_xor_fgUINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_xor,fgUINT32);
}
void flgr2d_arith_xor_fgINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_xor,fgINT8);
}
void flgr2d_arith_xor_fgINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_xor,fgINT16);
}
void flgr2d_arith_xor_fgINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_xor,fgINT32);
}
void flgr2d_arith_xor_fgFLOAT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  flgr_no_define_type_function(FLGR_FLOAT32);
}
void flgr2d_arith_xor_fgFLOAT64(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  flgr_no_define_type_function(FLGR_FLOAT64);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Xor element by element over two FLGR_Data2D
 *  @param datdest : pointer to FLGR_Data2D
 *  @param data1 : pointer to FLGR_Data2D
 *  @param data2 : pointer to FLGR_Data2D
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr2d_arith_xor(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_Ret ret;

  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL) || (data2==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr2d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;
  if((ret = flgr2d_is_data_same_attributes(data2,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr2d_arith_xor,datdest,data1,data2);

}


/*******************************************************************************
 * ATAN2
 *******************************************************************************/

void flgr2d_arith_atan2_fgBIT(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  flgr_no_define_type_function(FLGR_BIT);
}
void flgr2d_arith_atan2_fgUINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  flgr_no_define_type_function(FLGR_UINT8);
}
void flgr2d_arith_atan2_fgUINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  flgr_no_define_type_function(FLGR_UINT16);
}
void flgr2d_arith_atan2_fgUINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  flgr_no_define_type_function(FLGR_UINT32);
}
void flgr2d_arith_atan2_fgINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  flgr_no_define_type_function(FLGR_INT8);
}
void flgr2d_arith_atan2_fgINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  flgr_no_define_type_function(FLGR_INT16);
}
void flgr2d_arith_atan2_fgINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  flgr_no_define_type_function(FLGR_INT32);
}
void flgr2d_arith_atan2_fgFLOAT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_atan2,fgFLOAT32);
}
void flgr2d_arith_atan2_fgFLOAT64(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_atan2,fgFLOAT64);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Atan2 element by element over two FLGR_Data2D
 *  @param datdest : pointer to FLGR_Data2D
 *  @param data1 : pointer to FLGR_Data2D
 *  @param data2 : pointer to FLGR_Data2D
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr2d_arith_atan2(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_Ret ret;

  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL) || (data2==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr2d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;
  if((ret = flgr2d_is_data_same_attributes(data2,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr2d_arith_atan2,datdest,data1,data2);

}


/*******************************************************************************
 * ARGUMENT
 *******************************************************************************/

void flgr2d_arith_argument_fgBIT(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  flgr_no_define_type_function(FLGR_BIT);
}
void flgr2d_arith_argument_fgUINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_argument,fgUINT8);
}
void flgr2d_arith_argument_fgUINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_argument,fgUINT16);
}
void flgr2d_arith_argument_fgUINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_argument,fgUINT32);
}
void flgr2d_arith_argument_fgINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_argument,fgINT8);
}
void flgr2d_arith_argument_fgINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_argument,fgINT16);
}
void flgr2d_arith_argument_fgINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_argument,fgINT32);
}
void flgr2d_arith_argument_fgFLOAT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_argument,fgFLOAT32);
}
void flgr2d_arith_argument_fgFLOAT64(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_argument,fgFLOAT64);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Argument element by element over two FLGR_Data2D
 *  @param datdest : pointer to FLGR_Data2D
 *  @param data1 : pointer to FLGR_Data2D
 *  @param data2 : pointer to FLGR_Data2D
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr2d_arith_argument(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_Ret ret;

  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL) || (data2==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr2d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;
  if((ret = flgr2d_is_data_same_attributes(data2,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr2d_arith_argument,datdest,data1,data2);

}



/*******************************************************************************
 * MODULE
 *******************************************************************************/

void flgr2d_arith_module_fgBIT(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  flgr_no_define_type_function(FLGR_BIT);
}
void flgr2d_arith_module_fgUINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_module,fgUINT8);
}
void flgr2d_arith_module_fgUINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_module,fgUINT16);
}
void flgr2d_arith_module_fgUINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_module,fgUINT32);
}
void flgr2d_arith_module_fgINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_module,fgINT8);
}
void flgr2d_arith_module_fgINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_module,fgINT16);
}
void flgr2d_arith_module_fgINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_module,fgINT32);
}
void flgr2d_arith_module_fgFLOAT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_module,fgFLOAT32);
}
void flgr2d_arith_module_fgFLOAT64(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_module,fgFLOAT64);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Module element by element over two FLGR_Data2D
 *  @param datdest : pointer to FLGR_Data2D
 *  @param data1 : pointer to FLGR_Data2D
 *  @param data2 : pointer to FLGR_Data2D
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr2d_arith_module(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_Ret ret;

  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL) || (data2==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr2d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;
  if((ret = flgr2d_is_data_same_attributes(data2,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr2d_arith_module,datdest,data1,data2);

}


/*******************************************************************************
 * MULTSAT
 *******************************************************************************/

void flgr2d_arith_multsat_fgBIT(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  flgr_no_define_type_function(FLGR_BIT);
}
void flgr2d_arith_multsat_fgUINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_multsat,fgUINT8);
}
void flgr2d_arith_multsat_fgUINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_multsat,fgUINT16);
}
void flgr2d_arith_multsat_fgUINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_multsat,fgUINT32);
}
void flgr2d_arith_multsat_fgINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_multsat,fgINT8);
}
void flgr2d_arith_multsat_fgINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_multsat,fgINT16);
}
void flgr2d_arith_multsat_fgINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_multsat,fgINT32);
}
void flgr2d_arith_multsat_fgFLOAT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  flgr_no_define_type_function(FLGR_FLOAT32);
}
void flgr2d_arith_multsat_fgFLOAT64(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  flgr_no_define_type_function(FLGR_FLOAT64);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Multsat element by element over two FLGR_Data2D
 *  @param datdest : pointer to FLGR_Data2D
 *  @param data1 : pointer to FLGR_Data2D
 *  @param data2 : pointer to FLGR_Data2D
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr2d_arith_multsat(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_Ret ret;

  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL) || (data2==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr2d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;
  if((ret = flgr2d_is_data_same_attributes(data2,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr2d_arith_multsat,datdest,data1,data2);

}



/*******************************************************************************
 * SUBSAT
 *******************************************************************************/

void flgr2d_arith_subsat_fgBIT(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  flgr_no_define_type_function(FLGR_BIT);
}
void flgr2d_arith_subsat_fgUINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_subsat,fgUINT8);
}
void flgr2d_arith_subsat_fgUINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_subsat,fgUINT16);
}
void flgr2d_arith_subsat_fgUINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_subsat,fgUINT32);
}
void flgr2d_arith_subsat_fgINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_subsat,fgINT8);
}
void flgr2d_arith_subsat_fgINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_subsat,fgINT16);
}
void flgr2d_arith_subsat_fgINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_subsat,fgINT32);
}
void flgr2d_arith_subsat_fgFLOAT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  flgr_no_define_type_function(FLGR_FLOAT32);
}
void flgr2d_arith_subsat_fgFLOAT64(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  flgr_no_define_type_function(FLGR_FLOAT64);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Subsat element by element over two FLGR_Data2D
 *  @param datdest : pointer to FLGR_Data2D
 *  @param data1 : pointer to FLGR_Data2D
 *  @param data2 : pointer to FLGR_Data2D
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr2d_arith_subsat(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_Ret ret;

  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL) || (data2==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr2d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;
  if((ret = flgr2d_is_data_same_attributes(data2,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr2d_arith_subsat,datdest,data1,data2);

}



/*******************************************************************************
 * ADDSAT
 *******************************************************************************/

void flgr2d_arith_addsat_fgBIT(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  flgr_no_define_type_function(FLGR_BIT);
}
void flgr2d_arith_addsat_fgUINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_addsat,fgUINT8);
}
void flgr2d_arith_addsat_fgUINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_addsat,fgUINT16);
}
void flgr2d_arith_addsat_fgUINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_addsat,fgUINT32);
}
void flgr2d_arith_addsat_fgINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_addsat,fgINT8);
}
void flgr2d_arith_addsat_fgINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_addsat,fgINT16);
}
void flgr2d_arith_addsat_fgINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_addsat,fgINT32);
}
void flgr2d_arith_addsat_fgFLOAT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  flgr_no_define_type_function(FLGR_FLOAT32);
}
void flgr2d_arith_addsat_fgFLOAT64(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  flgr_no_define_type_function(FLGR_FLOAT64);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Addsat element by element over two FLGR_Data2D
 *  @param datdest : pointer to FLGR_Data2D
 *  @param data1 : pointer to FLGR_Data2D
 *  @param data2 : pointer to FLGR_Data2D
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr2d_arith_addsat(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_Ret ret;

  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL) || (data2==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr2d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;
  if((ret = flgr2d_is_data_same_attributes(data2,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr2d_arith_addsat,datdest,data1,data2);

}



/*******************************************************************************
 * DIV
 *******************************************************************************/

void flgr2d_arith_div_fgBIT(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  flgr_no_define_type_function(FLGR_BIT);
}
void flgr2d_arith_div_fgUINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_div,fgUINT8);
}
void flgr2d_arith_div_fgUINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_div,fgUINT16);
}
void flgr2d_arith_div_fgUINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_div,fgUINT32);
}
void flgr2d_arith_div_fgINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_div,fgINT8);
}
void flgr2d_arith_div_fgINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_div,fgINT16);
}
void flgr2d_arith_div_fgINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_div,fgINT32);
}
void flgr2d_arith_div_fgFLOAT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_div,fgFLOAT32);
}
void flgr2d_arith_div_fgFLOAT64(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_div,fgFLOAT64);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Div element by element over two FLGR_Data2D
 *  @param datdest : pointer to FLGR_Data2D
 *  @param data1 : pointer to FLGR_Data2D
 *  @param data2 : pointer to FLGR_Data2D
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr2d_arith_div(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_Ret ret;

  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL) || (data2==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr2d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;
  if((ret = flgr2d_is_data_same_attributes(data2,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr2d_arith_div,datdest,data1,data2);

}



/*******************************************************************************
 * MULT
 *******************************************************************************/

void flgr2d_arith_mult_fgBIT(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  flgr_no_define_type_function(FLGR_BIT);
}
void flgr2d_arith_mult_fgUINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_mult,fgUINT8);
}
void flgr2d_arith_mult_fgUINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_mult,fgUINT16);
}
void flgr2d_arith_mult_fgUINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_mult,fgUINT32);
}
void flgr2d_arith_mult_fgINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_mult,fgINT8);
}
void flgr2d_arith_mult_fgINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_mult,fgINT16);
}
void flgr2d_arith_mult_fgINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_mult,fgINT32);
}
void flgr2d_arith_mult_fgFLOAT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_mult,fgFLOAT32);
}
void flgr2d_arith_mult_fgFLOAT64(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_mult,fgFLOAT64);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Mult element by element over two FLGR_Data2D
 *  @param datdest : pointer to FLGR_Data2D
 *  @param data1 : pointer to FLGR_Data2D
 *  @param data2 : pointer to FLGR_Data2D
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr2d_arith_mult(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_Ret ret;

  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL) || (data2==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr2d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;
  if((ret = flgr2d_is_data_same_attributes(data2,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr2d_arith_mult,datdest,data1,data2);

}


/*******************************************************************************
 * SUB
 *******************************************************************************/

void flgr2d_arith_sub_fgBIT(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_sub,fgBIT);
}
void flgr2d_arith_sub_fgUINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_sub,fgUINT8);
}
void flgr2d_arith_sub_fgUINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_sub,fgUINT16);
}
void flgr2d_arith_sub_fgUINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_sub,fgUINT32);
}
void flgr2d_arith_sub_fgINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_sub,fgINT8);
}
void flgr2d_arith_sub_fgINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_sub,fgINT16);
}
void flgr2d_arith_sub_fgINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_sub,fgINT32);
}
void flgr2d_arith_sub_fgFLOAT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_sub,fgFLOAT32);
}
void flgr2d_arith_sub_fgFLOAT64(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_sub,fgFLOAT64);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Sub element by element over two FLGR_Data2D
 *  @param datdest : pointer to FLGR_Data2D
 *  @param data1 : pointer to FLGR_Data2D
 *  @param data2 : pointer to FLGR_Data2D
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr2d_arith_sub(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_Ret ret;

  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL) || (data2==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr2d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;
  if((ret = flgr2d_is_data_same_attributes(data2,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr2d_arith_sub,datdest,data1,data2);

}


/*******************************************************************************
 * ADD
 *******************************************************************************/

void flgr2d_arith_add_fgBIT(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_add,fgBIT);
}
void flgr2d_arith_add_fgUINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_add,fgUINT8);
}
void flgr2d_arith_add_fgUINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_add,fgUINT16);
}
void flgr2d_arith_add_fgUINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_add,fgUINT32);
}
void flgr2d_arith_add_fgINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_add,fgINT8);
}
void flgr2d_arith_add_fgINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_add,fgINT16);
}
void flgr2d_arith_add_fgINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_add,fgINT32);
}
void flgr2d_arith_add_fgFLOAT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_add,fgFLOAT32);
}
void flgr2d_arith_add_fgFLOAT64(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_MACRO_ARITH_2D_DIADIC(flgr1d_arith_add,fgFLOAT64);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Add element by element over two FLGR_Data2D
 *  @param datdest : pointer to FLGR_Data2D
 *  @param data1 : pointer to FLGR_Data2D
 *  @param data2 : pointer to FLGR_Data2D
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr2d_arith_add(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Data2D *data2) {
  FLGR_Ret ret;

  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL) || (data2==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr2d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;
  if((ret = flgr2d_is_data_same_attributes(data2,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr2d_arith_add,datdest,data1,data2);

}





/*******************************************************************************
 *******************************************************************************
 *******************************************************************************
 * DIADIC CONST OPERATIONS
 *******************************************************************************
 *******************************************************************************
 *******************************************************************************/


/*******************************************************************************
 * INF CONST
 *******************************************************************************/

void flgr2d_arith_const_inf_fgBIT(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_inf,fgBIT);
}
void flgr2d_arith_const_inf_fgUINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_inf,fgUINT8);
}
void flgr2d_arith_const_inf_fgUINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_inf,fgUINT16);
}
void flgr2d_arith_const_inf_fgUINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_inf,fgUINT32);
}
void flgr2d_arith_const_inf_fgINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_inf,fgINT8);
}
void flgr2d_arith_const_inf_fgINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_inf,fgINT16);
}
void flgr2d_arith_const_inf_fgINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_inf,fgINT32);
}
void flgr2d_arith_const_inf_fgFLOAT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_inf,fgFLOAT32);
}
void flgr2d_arith_const_inf_fgFLOAT64(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_inf,fgFLOAT64);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Inf with a constant every pixels
 *  @param datdest : pointer to FLGR_Data2D
 *  @param data1 : pointer to FLGR_Data2D
 *  @param vec_const : pointer to a Vector
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr2d_arith_const_inf_ptr(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_Ret ret;

  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr2d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr2d_arith_const_inf,datdest,data1,vec_const);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Inf with a constant every pixels
 *  @param datdest : pointer to FLGR_Data2D
 *  @param data1 : pointer to FLGR_Data2D
 *  @param constant : string representing a constant
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr2d_arith_const_inf_str(FLGR_Data2D *datdest, FLGR_Data2D *data1, char *constant) {
  int ret;
  FLGR_Vector *vector_constant;

  if((data1==NULL) || (datdest==NULL))  {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  vector_constant = flgr_vector_create(data1->spp,data1->type);

  if((ret=flgr_vector_import_string(vector_constant, constant))
     != FLGR_RET_OK) {

    POST_ERROR("String is not valid ""%s""\n",constant);
    flgr_vector_destroy(vector_constant);
    return ret;
  }

  ret = flgr2d_arith_const_inf_ptr(datdest,data1,vector_constant);

  flgr_vector_destroy(vector_constant);

  return ret;

}




/*******************************************************************************
 * SUP CONST
 *******************************************************************************/

void flgr2d_arith_const_sup_fgBIT(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_sup,fgBIT);
}
void flgr2d_arith_const_sup_fgUINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_sup,fgUINT8);
}
void flgr2d_arith_const_sup_fgUINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_sup,fgUINT16);
}
void flgr2d_arith_const_sup_fgUINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_sup,fgUINT32);
}
void flgr2d_arith_const_sup_fgINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_sup,fgINT8);
}
void flgr2d_arith_const_sup_fgINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_sup,fgINT16);
}
void flgr2d_arith_const_sup_fgINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_sup,fgINT32);
}
void flgr2d_arith_const_sup_fgFLOAT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_sup,fgFLOAT32);
}
void flgr2d_arith_const_sup_fgFLOAT64(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_sup,fgFLOAT64);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Sup with a constant every pixels
 *  @param datdest : pointer to FLGR_Data2D
 *  @param data1 : pointer to FLGR_Data2D
 *  @param vec_const : pointer to a Vector
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr2d_arith_const_sup_ptr(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_Ret ret;

  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr2d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr2d_arith_const_sup,datdest,data1,vec_const);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Sup with a constant every pixels
 *  @param datdest : pointer to FLGR_Data2D
 *  @param data1 : pointer to FLGR_Data2D
 *  @param constant : string representing a constant
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr2d_arith_const_sup_str(FLGR_Data2D *datdest, FLGR_Data2D *data1, char *constant) {
  int ret;
  FLGR_Vector *vector_constant;

  if((data1==NULL) || (datdest==NULL))  {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  vector_constant = flgr_vector_create(data1->spp,data1->type);

  if((ret=flgr_vector_import_string(vector_constant, constant))
     != FLGR_RET_OK) {

    POST_ERROR("String is not valid ""%s""\n",constant);
    flgr_vector_destroy(vector_constant);
    return ret;
  }

  ret = flgr2d_arith_const_sup_ptr(datdest,data1,vector_constant);


  flgr_vector_destroy(vector_constant);

  return ret;

}



/*******************************************************************************
 * AND CONST
 *******************************************************************************/

void flgr2d_arith_const_and_fgBIT(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_and,fgBIT);
}
void flgr2d_arith_const_and_fgUINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_and,fgUINT8);
}
void flgr2d_arith_const_and_fgUINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_and,fgUINT16);
}
void flgr2d_arith_const_and_fgUINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_and,fgUINT32);
}
void flgr2d_arith_const_and_fgINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_and,fgINT8);
}
void flgr2d_arith_const_and_fgINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_and,fgINT16);
}
void flgr2d_arith_const_and_fgINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_and,fgINT32);
}
void flgr2d_arith_const_and_fgFLOAT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  flgr_no_define_type_function(FLGR_FLOAT32);
}
void flgr2d_arith_const_and_fgFLOAT64(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  flgr_no_define_type_function(FLGR_FLOAT64);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute And with a constant every pixels
 *  @param datdest : pointer to FLGR_Data2D
 *  @param data1 : pointer to FLGR_Data2D
 *  @param vec_const : pointer to a Vector
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr2d_arith_const_and_ptr(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_Ret ret;

  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr2d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr2d_arith_const_and,datdest,data1,vec_const);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute And with a constant every pixels
 *  @param datdest : pointer to FLGR_Data2D
 *  @param data1 : pointer to FLGR_Data2D
 *  @param constant : string representing a constant
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr2d_arith_const_and_str(FLGR_Data2D *datdest, FLGR_Data2D *data1, char *constant) {
  int ret;
  FLGR_Vector *vector_constant;

  if((data1==NULL) || (datdest==NULL))  {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  vector_constant = flgr_vector_create(data1->spp,data1->type);

  if((ret=flgr_vector_import_string(vector_constant, constant))
     != FLGR_RET_OK) {

    POST_ERROR("String is not valid ""%s""\n",constant);
    flgr_vector_destroy(vector_constant);
    return ret;
  }

  ret = flgr2d_arith_const_and_ptr(datdest,data1,vector_constant);


  flgr_vector_destroy(vector_constant);

  return ret;

}



/*******************************************************************************
 * OR CONST
 *******************************************************************************/

void flgr2d_arith_const_or_fgBIT(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_or,fgBIT);
}
void flgr2d_arith_const_or_fgUINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_or,fgUINT8);
}
void flgr2d_arith_const_or_fgUINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_or,fgUINT16);
}
void flgr2d_arith_const_or_fgUINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_or,fgUINT32);
}
void flgr2d_arith_const_or_fgINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_or,fgINT8);
}
void flgr2d_arith_const_or_fgINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_or,fgINT16);
}
void flgr2d_arith_const_or_fgINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_or,fgINT32);
}
void flgr2d_arith_const_or_fgFLOAT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  flgr_no_define_type_function(FLGR_FLOAT32);
}
void flgr2d_arith_const_or_fgFLOAT64(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  flgr_no_define_type_function(FLGR_FLOAT64);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Or with a constant every pixels
 *  @param datdest : pointer to FLGR_Data2D
 *  @param data1 : pointer to FLGR_Data2D
 *  @param vec_const : pointer to a Vector
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr2d_arith_const_or_ptr(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_Ret ret;

  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr2d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr2d_arith_const_or,datdest,data1,vec_const);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Or with a constant every pixels
 *  @param datdest : pointer to FLGR_Data2D
 *  @param data1 : pointer to FLGR_Data2D
 *  @param constant : string representing a constant
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr2d_arith_const_or_str(FLGR_Data2D *datdest, FLGR_Data2D *data1, char *constant) {
  int ret;
  FLGR_Vector *vector_constant;

  if((data1==NULL) || (datdest==NULL))  {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  vector_constant = flgr_vector_create(data1->spp,data1->type);

  if((ret=flgr_vector_import_string(vector_constant, constant))
     != FLGR_RET_OK) {

    POST_ERROR("String is not valid ""%s""\n",constant);
    flgr_vector_destroy(vector_constant);
    return ret;
  }

  ret = flgr2d_arith_const_or_ptr(datdest,data1,vector_constant);


  flgr_vector_destroy(vector_constant);

  return ret;

}




/*******************************************************************************
 * XOR CONST
 *******************************************************************************/

void flgr2d_arith_const_xor_fgBIT(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_xor,fgBIT);
}
void flgr2d_arith_const_xor_fgUINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_xor,fgUINT8);
}
void flgr2d_arith_const_xor_fgUINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_xor,fgUINT16);
}
void flgr2d_arith_const_xor_fgUINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_xor,fgUINT32);
}
void flgr2d_arith_const_xor_fgINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_xor,fgINT8);
}
void flgr2d_arith_const_xor_fgINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_xor,fgINT16);
}
void flgr2d_arith_const_xor_fgINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_xor,fgINT32);
}
void flgr2d_arith_const_xor_fgFLOAT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  flgr_no_define_type_function(FLGR_FLOAT32);
}
void flgr2d_arith_const_xor_fgFLOAT64(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  flgr_no_define_type_function(FLGR_FLOAT64);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Xor with a constant every pixels
 *  @param datdest : pointer to FLGR_Data2D
 *  @param data1 : pointer to FLGR_Data2D
 *  @param vec_const : pointer to a Vector
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr2d_arith_const_xor_ptr(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_Ret ret;

  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr2d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr2d_arith_const_xor,datdest,data1,vec_const);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Xor with a constant every pixels
 *  @param datdest : pointer to FLGR_Data2D
 *  @param data1 : pointer to FLGR_Data2D
 *  @param constant : string representing a constant
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr2d_arith_const_xor_str(FLGR_Data2D *datdest, FLGR_Data2D *data1, char *constant) {
  int ret;
  FLGR_Vector *vector_constant;

  if((data1==NULL) || (datdest==NULL))  {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  vector_constant = flgr_vector_create(data1->spp,data1->type);

  if((ret=flgr_vector_import_string(vector_constant, constant))
     != FLGR_RET_OK) {

    POST_ERROR("String is not valid ""%s""\n",constant);
    flgr_vector_destroy(vector_constant);
    return ret;
  }

  ret = flgr2d_arith_const_xor_ptr(datdest,data1,vector_constant);

  flgr_vector_destroy(vector_constant);


  return ret;

}





/*******************************************************************************
 * ATAN2 CONST
 *******************************************************************************/

void flgr2d_arith_const_atan2_fgBIT(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  flgr_no_define_type_function(FLGR_BIT);
}
void flgr2d_arith_const_atan2_fgUINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  flgr_no_define_type_function(FLGR_UINT8);
}
void flgr2d_arith_const_atan2_fgUINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  flgr_no_define_type_function(FLGR_UINT16);
}
void flgr2d_arith_const_atan2_fgUINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  flgr_no_define_type_function(FLGR_UINT32);
}
void flgr2d_arith_const_atan2_fgINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  flgr_no_define_type_function(FLGR_INT8);
}
void flgr2d_arith_const_atan2_fgINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  flgr_no_define_type_function(FLGR_INT16);
}
void flgr2d_arith_const_atan2_fgINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  flgr_no_define_type_function(FLGR_INT32);
}
void flgr2d_arith_const_atan2_fgFLOAT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_atan2,fgFLOAT32);
}
void flgr2d_arith_const_atan2_fgFLOAT64(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_atan2,fgFLOAT64);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Atan2 with a constant every pixels
 *  @param datdest : pointer to FLGR_Data2D
 *  @param data1 : pointer to FLGR_Data2D
 *  @param vec_const : pointer to a Vector
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr2d_arith_const_atan2_ptr(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_Ret ret;

  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr2d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr2d_arith_const_atan2,datdest,data1,vec_const);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Atan2 with a constant every pixels
 *  @param datdest : pointer to FLGR_Data2D
 *  @param data1 : pointer to FLGR_Data2D
 *  @param constant : string representing a constant
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr2d_arith_const_atan2_str(FLGR_Data2D *datdest, FLGR_Data2D *data1, char *constant) {
  int ret;
  FLGR_Vector *vector_constant;

  if((data1==NULL) || (datdest==NULL))  {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  vector_constant = flgr_vector_create(data1->spp,data1->type);

  if((ret=flgr_vector_import_string(vector_constant, constant))
     != FLGR_RET_OK) {

    POST_ERROR("String is not valid ""%s""\n",constant);
    flgr_vector_destroy(vector_constant);
    return ret;
  }

  ret = flgr2d_arith_const_atan2_ptr(datdest,data1,vector_constant);


  flgr_vector_destroy(vector_constant);

  return ret;

}






/*******************************************************************************
 * ARGUMENT CONST
 *******************************************************************************/

void flgr2d_arith_const_argument_fgBIT(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  flgr_no_define_type_function(FLGR_BIT);
}
void flgr2d_arith_const_argument_fgUINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_argument,fgUINT8);
}
void flgr2d_arith_const_argument_fgUINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_argument,fgUINT16);
}
void flgr2d_arith_const_argument_fgUINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_argument,fgUINT32);
}
void flgr2d_arith_const_argument_fgINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_argument,fgINT8);
}
void flgr2d_arith_const_argument_fgINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_argument,fgINT16);
}
void flgr2d_arith_const_argument_fgINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_argument,fgINT32);
}
void flgr2d_arith_const_argument_fgFLOAT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_argument,fgFLOAT32);
}
void flgr2d_arith_const_argument_fgFLOAT64(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_argument,fgFLOAT64);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Argument with a constant every pixels
 *  @param datdest : pointer to FLGR_Data2D
 *  @param data1 : pointer to FLGR_Data2D
 *  @param vec_const : pointer to a Vector
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr2d_arith_const_argument_ptr(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_Ret ret;

  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr2d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr2d_arith_const_argument,datdest,data1,vec_const);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Argument with a constant every pixels
 *  @param datdest : pointer to FLGR_Data2D
 *  @param data1 : pointer to FLGR_Data2D
 *  @param constant : string representing a constant
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr2d_arith_const_argument_str(FLGR_Data2D *datdest, FLGR_Data2D *data1, char *constant) {
  int ret;
  FLGR_Vector *vector_constant;

  if((data1==NULL) || (datdest==NULL))  {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  vector_constant = flgr_vector_create(data1->spp,data1->type);

  if((ret=flgr_vector_import_string(vector_constant, constant))
     != FLGR_RET_OK) {

    POST_ERROR("String is not valid ""%s""\n",constant);
    flgr_vector_destroy(vector_constant);
    return ret;
  }


  ret = flgr2d_arith_const_argument_ptr(datdest,data1,vector_constant);

  flgr_vector_destroy(vector_constant);


  return ret;

}







/*******************************************************************************
 * MODULE CONST
 *******************************************************************************/

void flgr2d_arith_const_module_fgBIT(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  flgr_no_define_type_function(FLGR_BIT);
}
void flgr2d_arith_const_module_fgUINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_module,fgUINT8);
}
void flgr2d_arith_const_module_fgUINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_module,fgUINT16);
}
void flgr2d_arith_const_module_fgUINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_module,fgUINT32);
}
void flgr2d_arith_const_module_fgINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_module,fgINT8);
}
void flgr2d_arith_const_module_fgINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_module,fgINT16);
}
void flgr2d_arith_const_module_fgINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_module,fgINT32);
}
void flgr2d_arith_const_module_fgFLOAT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_module,fgFLOAT32);
}
void flgr2d_arith_const_module_fgFLOAT64(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_module,fgFLOAT64);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Module with a constant every pixels
 *  @param datdest : pointer to FLGR_Data2D
 *  @param data1 : pointer to FLGR_Data2D
 *  @param vec_const : pointer to a Vector
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr2d_arith_const_module_ptr(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_Ret ret;

  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr2d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr2d_arith_const_module,datdest,data1,vec_const);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Module with a constant every pixels
 *  @param datdest : pointer to FLGR_Data2D
 *  @param data1 : pointer to FLGR_Data2D
 *  @param constant : string representing a constant
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr2d_arith_const_module_str(FLGR_Data2D *datdest, FLGR_Data2D *data1, char *constant) {
  int ret;
  FLGR_Vector *vector_constant;

  if((data1==NULL) || (datdest==NULL))  {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  vector_constant = flgr_vector_create(data1->spp,data1->type);

  if((ret=flgr_vector_import_string(vector_constant, constant))
     != FLGR_RET_OK) {

    POST_ERROR("String is not valid ""%s""\n",constant);
    flgr_vector_destroy(vector_constant);
    return ret;
  }

  ret = flgr2d_arith_const_module_ptr(datdest,data1,vector_constant);

  flgr_vector_destroy(vector_constant);


  return ret;

}




/*******************************************************************************
 * MULTSAT CONST
 *******************************************************************************/

void flgr2d_arith_const_multsat_fgBIT(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  flgr_no_define_type_function(FLGR_BIT);
}
void flgr2d_arith_const_multsat_fgUINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_multsat,fgUINT8);
}
void flgr2d_arith_const_multsat_fgUINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_multsat,fgUINT16);
}
void flgr2d_arith_const_multsat_fgUINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_multsat,fgUINT32);
}
void flgr2d_arith_const_multsat_fgINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_multsat,fgINT8);
}
void flgr2d_arith_const_multsat_fgINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_multsat,fgINT16);
}
void flgr2d_arith_const_multsat_fgINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_multsat,fgINT32);
}
void flgr2d_arith_const_multsat_fgFLOAT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  flgr_no_define_type_function(FLGR_FLOAT32);
}
void flgr2d_arith_const_multsat_fgFLOAT64(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  flgr_no_define_type_function(FLGR_FLOAT64);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Multsat with a constant every pixels
 *  @param datdest : pointer to FLGR_Data2D
 *  @param data1 : pointer to FLGR_Data2D
 *  @param vec_const : pointer to a Vector
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr2d_arith_const_multsat_ptr(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_Ret ret;

  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr2d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr2d_arith_const_multsat,datdest,data1,vec_const);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Multsat with a constant every pixels
 *  @param datdest : pointer to FLGR_Data2D
 *  @param data1 : pointer to FLGR_Data2D
 *  @param constant : string representing a constant
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr2d_arith_const_multsat_str(FLGR_Data2D *datdest, FLGR_Data2D *data1, char *constant) {
  int ret;
  FLGR_Vector *vector_constant;

  if((data1==NULL) || (datdest==NULL))  {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  vector_constant = flgr_vector_create(data1->spp,data1->type);

  if((ret=flgr_vector_import_string(vector_constant, constant))
     != FLGR_RET_OK) {

    POST_ERROR("String is not valid ""%s""\n",constant);
    flgr_vector_destroy(vector_constant);
    return ret;
  }

  ret = flgr2d_arith_const_multsat_ptr(datdest,data1,vector_constant);

  flgr_vector_destroy(vector_constant);


  return ret;

}




/*******************************************************************************
 * SUBSAT CONST
 *******************************************************************************/

void flgr2d_arith_const_subsat_fgBIT(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  flgr_no_define_type_function(FLGR_BIT);
}
void flgr2d_arith_const_subsat_fgUINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_subsat,fgUINT8);
}
void flgr2d_arith_const_subsat_fgUINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_subsat,fgUINT16);
}
void flgr2d_arith_const_subsat_fgUINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_subsat,fgUINT32);
}
void flgr2d_arith_const_subsat_fgINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_subsat,fgINT8);
}
void flgr2d_arith_const_subsat_fgINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_subsat,fgINT16);
}
void flgr2d_arith_const_subsat_fgINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_subsat,fgINT32);
}
void flgr2d_arith_const_subsat_fgFLOAT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  flgr_no_define_type_function(FLGR_FLOAT32);
}
void flgr2d_arith_const_subsat_fgFLOAT64(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  flgr_no_define_type_function(FLGR_FLOAT64);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Subsat with a constant every pixels
 *  @param datdest : pointer to FLGR_Data2D
 *  @param data1 : pointer to FLGR_Data2D
 *  @param vec_const : pointer to a Vector
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr2d_arith_const_subsat_ptr(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_Ret ret;

  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr2d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr2d_arith_const_subsat,datdest,data1,vec_const);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Subsat with a constant every pixels
 *  @param datdest : pointer to FLGR_Data2D
 *  @param data1 : pointer to FLGR_Data2D
 *  @param constant : string representing a constant
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr2d_arith_const_subsat_str(FLGR_Data2D *datdest, FLGR_Data2D *data1, char *constant) {
  int ret;
  FLGR_Vector *vector_constant;

  if((data1==NULL) || (datdest==NULL))  {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  vector_constant = flgr_vector_create(data1->spp,data1->type);

  if((ret=flgr_vector_import_string(vector_constant, constant))
     != FLGR_RET_OK) {

    POST_ERROR("String is not valid ""%s""\n",constant);
    flgr_vector_destroy(vector_constant);
    return ret;
  }

  ret = flgr2d_arith_const_subsat_ptr(datdest,data1,vector_constant);

  flgr_vector_destroy(vector_constant);


  return ret;

}





/*******************************************************************************
 * ADDSAT CONST
 *******************************************************************************/

void flgr2d_arith_const_addsat_fgBIT(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  flgr_no_define_type_function(FLGR_BIT);
}
void flgr2d_arith_const_addsat_fgUINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_addsat,fgUINT8);
}
void flgr2d_arith_const_addsat_fgUINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_addsat,fgUINT16);
}
void flgr2d_arith_const_addsat_fgUINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_addsat,fgUINT32);
}
void flgr2d_arith_const_addsat_fgINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_addsat,fgINT8);
}
void flgr2d_arith_const_addsat_fgINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_addsat,fgINT16);
}
void flgr2d_arith_const_addsat_fgINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_addsat,fgINT32);
}
void flgr2d_arith_const_addsat_fgFLOAT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  flgr_no_define_type_function(FLGR_FLOAT32);
}
void flgr2d_arith_const_addsat_fgFLOAT64(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  flgr_no_define_type_function(FLGR_FLOAT64);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Addsat with a constant every pixels
 *  @param datdest : pointer to FLGR_Data2D
 *  @param data1 : pointer to FLGR_Data2D
 *  @param vec_const : pointer to a Vector
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr2d_arith_const_addsat_ptr(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_Ret ret;

  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr2d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr2d_arith_const_addsat,datdest,data1,vec_const);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Addsat with a constant every pixels
 *  @param datdest : pointer to FLGR_Data2D
 *  @param data1 : pointer to FLGR_Data2D
 *  @param constant : string representing a constant
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr2d_arith_const_addsat_str(FLGR_Data2D *datdest, FLGR_Data2D *data1, char *constant) {
  int ret;
  FLGR_Vector *vector_constant;

  if((data1==NULL) || (datdest==NULL))  {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  vector_constant = flgr_vector_create(data1->spp,data1->type);

  if((ret=flgr_vector_import_string(vector_constant, constant))
     != FLGR_RET_OK) {

    POST_ERROR("String is not valid ""%s""\n",constant);
    flgr_vector_destroy(vector_constant);
    return ret;
  }

  ret = flgr2d_arith_const_addsat_ptr(datdest,data1,vector_constant);

  flgr_vector_destroy(vector_constant);


  return ret;

}




/*******************************************************************************
 * DIV CONST
 *******************************************************************************/

void flgr2d_arith_const_div_fgBIT(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  flgr_no_define_type_function(FLGR_BIT);
}
void flgr2d_arith_const_div_fgUINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_div,fgUINT8);
}
void flgr2d_arith_const_div_fgUINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_div,fgUINT16);
}
void flgr2d_arith_const_div_fgUINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_div,fgUINT32);
}
void flgr2d_arith_const_div_fgINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_div,fgINT8);
}
void flgr2d_arith_const_div_fgINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_div,fgINT16);
}
void flgr2d_arith_const_div_fgINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_div,fgINT32);
}
void flgr2d_arith_const_div_fgFLOAT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_div,fgFLOAT32);
}
void flgr2d_arith_const_div_fgFLOAT64(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_div,fgFLOAT64);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Div with a constant every pixels
 *  @param datdest : pointer to FLGR_Data2D
 *  @param data1 : pointer to FLGR_Data2D
 *  @param vec_const : pointer to a Vector
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr2d_arith_const_div_ptr(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_Ret ret;

  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr2d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr2d_arith_const_div,datdest,data1,vec_const);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Div with a constant every pixels
 *  @param datdest : pointer to FLGR_Data2D
 *  @param data1 : pointer to FLGR_Data2D
 *  @param constant : string representing a constant
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr2d_arith_const_div_str(FLGR_Data2D *datdest, FLGR_Data2D *data1, char *constant) {
  int ret;
  FLGR_Vector *vector_constant;

  if((data1==NULL) || (datdest==NULL))  {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  vector_constant = flgr_vector_create(data1->spp,data1->type);

  if((ret=flgr_vector_import_string(vector_constant, constant))
     != FLGR_RET_OK) {

    POST_ERROR("String is not valid ""%s""\n",constant);
    flgr_vector_destroy(vector_constant);
    return ret;
  }

  ret = flgr2d_arith_const_div_ptr(datdest,data1,vector_constant);

  flgr_vector_destroy(vector_constant);


  return ret;

}






/*******************************************************************************
 * MULT CONST
 *******************************************************************************/

void flgr2d_arith_const_mult_fgBIT(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  flgr_no_define_type_function(FLGR_BIT);
}
void flgr2d_arith_const_mult_fgUINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_mult,fgUINT8);
}
void flgr2d_arith_const_mult_fgUINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_mult,fgUINT16);
}
void flgr2d_arith_const_mult_fgUINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_mult,fgUINT32);
}
void flgr2d_arith_const_mult_fgINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_mult,fgINT8);
}
void flgr2d_arith_const_mult_fgINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_mult,fgINT16);
}
void flgr2d_arith_const_mult_fgINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_mult,fgINT32);
}
void flgr2d_arith_const_mult_fgFLOAT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_mult,fgFLOAT32);
}
void flgr2d_arith_const_mult_fgFLOAT64(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_mult,fgFLOAT64);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Mult with a constant every pixels
 *  @param datdest : pointer to FLGR_Data2D
 *  @param data1 : pointer to FLGR_Data2D
 *  @param vec_const : pointer to a Vector
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr2d_arith_const_mult_ptr(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_Ret ret;

  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr2d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr2d_arith_const_mult,datdest,data1,vec_const);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Mult with a constant every pixels
 *  @param datdest : pointer to FLGR_Data2D
 *  @param data1 : pointer to FLGR_Data2D
 *  @param constant : string representing a constant
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr2d_arith_const_mult_str(FLGR_Data2D *datdest, FLGR_Data2D *data1, char *constant) {
  int ret;
  FLGR_Vector *vector_constant;

  if((data1==NULL) || (datdest==NULL))  {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  vector_constant = flgr_vector_create(data1->spp,data1->type);

  if((ret=flgr_vector_import_string(vector_constant, constant))
     != FLGR_RET_OK) {

    POST_ERROR("String is not valid ""%s""\n",constant);
    flgr_vector_destroy(vector_constant);
    return ret;
  }

  ret = flgr2d_arith_const_mult_ptr(datdest,data1,vector_constant);

  flgr_vector_destroy(vector_constant);


  return ret;

}





/*******************************************************************************
 * SUB CONST
 *******************************************************************************/

void flgr2d_arith_const_sub_fgBIT(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  flgr_no_define_type_function(FLGR_BIT);
}
void flgr2d_arith_const_sub_fgUINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_sub,fgUINT8);
}
void flgr2d_arith_const_sub_fgUINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_sub,fgUINT16);
}
void flgr2d_arith_const_sub_fgUINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_sub,fgUINT32);
}
void flgr2d_arith_const_sub_fgINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_sub,fgINT8);
}
void flgr2d_arith_const_sub_fgINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_sub,fgINT16);
}
void flgr2d_arith_const_sub_fgINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_sub,fgINT32);
}
void flgr2d_arith_const_sub_fgFLOAT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_sub,fgFLOAT32);
}
void flgr2d_arith_const_sub_fgFLOAT64(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_sub,fgFLOAT64);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Sub with a constant every pixels
 *  @param datdest : pointer to FLGR_Data2D
 *  @param data1 : pointer to FLGR_Data2D
 *  @param vec_const : pointer to a Vector
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr2d_arith_const_sub_ptr(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_Ret ret;

  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr2d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr2d_arith_const_sub,datdest,data1,vec_const);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Sub with a constant every pixels
 *  @param datdest : pointer to FLGR_Data2D
 *  @param data1 : pointer to FLGR_Data2D
 *  @param constant : string representing a constant
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr2d_arith_const_sub_str(FLGR_Data2D *datdest, FLGR_Data2D *data1, char *constant) {
  int ret;
  FLGR_Vector *vector_constant;

  if((data1==NULL) || (datdest==NULL))  {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  vector_constant = flgr_vector_create(data1->spp,data1->type);

  if((ret=flgr_vector_import_string(vector_constant, constant))
     != FLGR_RET_OK) {

    POST_ERROR("String is not valid ""%s""\n",constant);
    flgr_vector_destroy(vector_constant);
    return ret;
  }

  ret = flgr2d_arith_const_sub_ptr(datdest,data1,vector_constant);

  flgr_vector_destroy(vector_constant);


  return ret;

}







/*******************************************************************************
 * ADD CONST
 *******************************************************************************/

void flgr2d_arith_const_add_fgBIT(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  flgr_no_define_type_function(FLGR_BIT);
}
void flgr2d_arith_const_add_fgUINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_add,fgUINT8);
}
void flgr2d_arith_const_add_fgUINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_add,fgUINT16);
}
void flgr2d_arith_const_add_fgUINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_add,fgUINT32);
}
void flgr2d_arith_const_add_fgINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_add,fgINT8);
}
void flgr2d_arith_const_add_fgINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_add,fgINT16);
}
void flgr2d_arith_const_add_fgINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_add,fgINT32);
}
void flgr2d_arith_const_add_fgFLOAT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_add,fgFLOAT32);
}
void flgr2d_arith_const_add_fgFLOAT64(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_MACRO_ARITH_2D_DIADIC_CONST(flgr1d_arith_const_add,fgFLOAT64);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Add with a constant every pixels
 *  @param datdest : pointer to FLGR_Data2D
 *  @param data1 : pointer to FLGR_Data2D
 *  @param vec_const : pointer to a Vector
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr2d_arith_const_add_ptr(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_const) {
  FLGR_Ret ret;

  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr2d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr2d_arith_const_add,datdest,data1,vec_const);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Add with a constant every pixels
 *  @param datdest : pointer to FLGR_Data2D
 *  @param data1 : pointer to FLGR_Data2D
 *  @param constant : string representing a constant
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr2d_arith_const_add_str(FLGR_Data2D *datdest, FLGR_Data2D *data1, char *constant) {
  int ret;
  FLGR_Vector *vector_constant;

  if((data1==NULL) || (datdest==NULL))  {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  vector_constant = flgr_vector_create(data1->spp,data1->type);

  if((ret=flgr_vector_import_string(vector_constant, constant))
     != FLGR_RET_OK) {

    POST_ERROR("String is not valid ""%s""\n",constant);
    flgr_vector_destroy(vector_constant);
    return ret;
  }

  ret = flgr2d_arith_const_add_ptr(datdest,data1,vector_constant);

  flgr_vector_destroy(vector_constant);


  return ret;

}

//! @}

/*!
 * \addtogroup group_fulguro_arith_oneimg
 * @{
 */



/*******************************************************************************
 * Log base b
 *******************************************************************************/

void flgr2d_arith_logb_fgBIT(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_base) {
  flgr_no_define_type_function(FLGR_BIT);
}
void flgr2d_arith_logb_fgUINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_base) {
  FLGR_MACRO_ARITH_2D_MONOADIC_PARAM(flgr1d_arith_logb,fgUINT8,vec_base);
}
void flgr2d_arith_logb_fgUINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_base) {
  FLGR_MACRO_ARITH_2D_MONOADIC_PARAM(flgr1d_arith_logb,fgUINT16,vec_base);
}
void flgr2d_arith_logb_fgUINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_base) {
  FLGR_MACRO_ARITH_2D_MONOADIC_PARAM(flgr1d_arith_logb,fgUINT32,vec_base);
}
void flgr2d_arith_logb_fgINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_base) {
  FLGR_MACRO_ARITH_2D_MONOADIC_PARAM(flgr1d_arith_logb,fgINT8,vec_base);
}
void flgr2d_arith_logb_fgINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_base) {
  FLGR_MACRO_ARITH_2D_MONOADIC_PARAM(flgr1d_arith_logb,fgINT16,vec_base);
}
void flgr2d_arith_logb_fgINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_base) {
  FLGR_MACRO_ARITH_2D_MONOADIC_PARAM(flgr1d_arith_logb,fgINT32,vec_base);
}
void flgr2d_arith_logb_fgFLOAT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_base) {
  FLGR_MACRO_ARITH_2D_MONOADIC_PARAM(flgr1d_arith_logb,fgFLOAT32,vec_base);
}
void flgr2d_arith_logb_fgFLOAT64(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_base) {
  FLGR_MACRO_ARITH_2D_MONOADIC_PARAM(flgr1d_arith_logb,fgFLOAT64,vec_base);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Log on pixels
 *  @param datdest : pointer to FLGR_Data2D
 *  @param data1 : pointer to FLGR_Data2D
 *  @param base : base of the log
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr2d_arith_logb(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *base) {
  FLGR_Ret ret;

  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr2d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr2d_arith_logb,datdest,data1,base);
}





/*******************************************************************************
 * Pow base b
 *******************************************************************************/

void flgr2d_arith_powb_fgBIT(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_power) {
  flgr_no_define_type_function(FLGR_BIT);
}
void flgr2d_arith_powb_fgUINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_power) {
  FLGR_MACRO_ARITH_2D_MONOADIC_PARAM(flgr1d_arith_powb,fgUINT8,vec_power);
}
void flgr2d_arith_powb_fgUINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_power) {
  FLGR_MACRO_ARITH_2D_MONOADIC_PARAM(flgr1d_arith_powb,fgUINT16,vec_power);
}
void flgr2d_arith_powb_fgUINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_power) {
  FLGR_MACRO_ARITH_2D_MONOADIC_PARAM(flgr1d_arith_powb,fgUINT32,vec_power);
}
void flgr2d_arith_powb_fgINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_power) {
  FLGR_MACRO_ARITH_2D_MONOADIC_PARAM(flgr1d_arith_powb,fgINT8,vec_power);
}
void flgr2d_arith_powb_fgINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_power) {
  FLGR_MACRO_ARITH_2D_MONOADIC_PARAM(flgr1d_arith_powb,fgINT16,vec_power);
}
void flgr2d_arith_powb_fgINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_power) {
  FLGR_MACRO_ARITH_2D_MONOADIC_PARAM(flgr1d_arith_powb,fgINT32,vec_power);
}
void flgr2d_arith_powb_fgFLOAT32(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_power) {
  FLGR_MACRO_ARITH_2D_MONOADIC_PARAM(flgr1d_arith_powb,fgFLOAT32,vec_power);
}
void flgr2d_arith_powb_fgFLOAT64(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *vec_power) {
  FLGR_MACRO_ARITH_2D_MONOADIC_PARAM(flgr1d_arith_powb,fgFLOAT64,vec_power);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Pow on pixels
 *  @param datdest : pointer to FLGR_Data2D
 *  @param data1 : pointer to FLGR_Data2D
 *  @param base : base of the pow
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr2d_arith_powb(FLGR_Data2D *datdest, FLGR_Data2D *data1, FLGR_Vector *base) {
  FLGR_Ret ret;

  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr2d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr2d_arith_powb,datdest,data1,base);
}




/*******************************************************************************
 *******************************************************************************
 *******************************************************************************
 * MONO OPERATIONS
 *******************************************************************************
 *******************************************************************************
 *******************************************************************************/



/*******************************************************************************
 * INVERT
 *******************************************************************************/

void flgr2d_arith_invert_fgBIT(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  flgr_no_define_type_function(FLGR_BIT);
}
void flgr2d_arith_invert_fgUINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  FLGR_MACRO_ARITH_2D_MONOADIC(flgr1d_arith_invert,fgUINT8);
}

void flgr2d_arith_invert_fgUINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  FLGR_MACRO_ARITH_2D_MONOADIC(flgr1d_arith_invert,fgUINT16);
}

void flgr2d_arith_invert_fgUINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  FLGR_MACRO_ARITH_2D_MONOADIC(flgr1d_arith_invert,fgUINT32);
}

void flgr2d_arith_invert_fgINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  FLGR_MACRO_ARITH_2D_MONOADIC(flgr1d_arith_invert,fgINT8);
}

void flgr2d_arith_invert_fgINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  FLGR_MACRO_ARITH_2D_MONOADIC(flgr1d_arith_invert,fgINT16);
}

void flgr2d_arith_invert_fgINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  FLGR_MACRO_ARITH_2D_MONOADIC(flgr1d_arith_invert,fgINT32);
}

void flgr2d_arith_invert_fgFLOAT32(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  FLGR_MACRO_ARITH_2D_MONOADIC(flgr1d_arith_invert,fgFLOAT32);
}

void flgr2d_arith_invert_fgFLOAT64(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  FLGR_MACRO_ARITH_2D_MONOADIC(flgr1d_arith_invert,fgFLOAT64);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Invert all pixels
 *  @param datdest : pointer to FLGR_Data2D
 *  @param data1 : pointer to FLGR_Data2D
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr2d_arith_invert(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  FLGR_Ret ret;

  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr2d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr2d_arith_invert,datdest,data1);

}



/*******************************************************************************
 * ABS
 *******************************************************************************/

void flgr2d_arith_abs_fgBIT(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  flgr_no_define_type_function(FLGR_BIT);
}
void flgr2d_arith_abs_fgUINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  flgr_no_define_type_function(FLGR_UINT8);
}

void flgr2d_arith_abs_fgUINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  flgr_no_define_type_function(FLGR_UINT16);
}

void flgr2d_arith_abs_fgUINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  flgr_no_define_type_function(FLGR_UINT32);
}

void flgr2d_arith_abs_fgINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  FLGR_MACRO_ARITH_2D_MONOADIC(flgr1d_arith_abs,fgINT8);
}

void flgr2d_arith_abs_fgINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  FLGR_MACRO_ARITH_2D_MONOADIC(flgr1d_arith_abs,fgINT16);
}

void flgr2d_arith_abs_fgINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  FLGR_MACRO_ARITH_2D_MONOADIC(flgr1d_arith_abs,fgINT32);
}

void flgr2d_arith_abs_fgFLOAT32(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  FLGR_MACRO_ARITH_2D_MONOADIC(flgr1d_arith_abs,fgFLOAT32);
}

void flgr2d_arith_abs_fgFLOAT64(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  FLGR_MACRO_ARITH_2D_MONOADIC(flgr1d_arith_abs,fgFLOAT64);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Absolute values on all pixels
 *  @param datdest : pointer to FLGR_Data2D
 *  @param data1 : pointer to FLGR_Data2D
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr2d_arith_abs(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  FLGR_Ret ret;

  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr2d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr2d_arith_abs,datdest,data1);

}



/*******************************************************************************
 * COS
 *******************************************************************************/

void flgr2d_arith_cos_fgBIT(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  flgr_no_define_type_function(FLGR_BIT);
}
void flgr2d_arith_cos_fgUINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  flgr_no_define_type_function(FLGR_UINT8);
}

void flgr2d_arith_cos_fgUINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  flgr_no_define_type_function(FLGR_UINT16);
}

void flgr2d_arith_cos_fgUINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  flgr_no_define_type_function(FLGR_UINT32);
}

void flgr2d_arith_cos_fgINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  flgr_no_define_type_function(FLGR_INT8);
}

void flgr2d_arith_cos_fgINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  flgr_no_define_type_function(FLGR_INT16);
}

void flgr2d_arith_cos_fgINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  flgr_no_define_type_function(FLGR_INT32);
}

void flgr2d_arith_cos_fgFLOAT32(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  FLGR_MACRO_ARITH_2D_MONOADIC(flgr1d_arith_cos,fgFLOAT32);
}

void flgr2d_arith_cos_fgFLOAT64(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  FLGR_MACRO_ARITH_2D_MONOADIC(flgr1d_arith_cos,fgFLOAT64);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Cosine on all pixels
 *  @param datdest : pointer to FLGR_Data2D
 *  @param data1 : pointer to FLGR_Data2D
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr2d_arith_cos(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  FLGR_Ret ret;

  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr2d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr2d_arith_cos,datdest,data1);

}

/*******************************************************************************
 * SIN
 *******************************************************************************/

void flgr2d_arith_sin_fgBIT(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  flgr_no_define_type_function(FLGR_BIT);
}
void flgr2d_arith_sin_fgUINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  flgr_no_define_type_function(FLGR_UINT8);
}

void flgr2d_arith_sin_fgUINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  flgr_no_define_type_function(FLGR_UINT16);
}

void flgr2d_arith_sin_fgUINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  flgr_no_define_type_function(FLGR_UINT32);
}

void flgr2d_arith_sin_fgINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  flgr_no_define_type_function(FLGR_INT8);
}

void flgr2d_arith_sin_fgINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  flgr_no_define_type_function(FLGR_INT16);
}

void flgr2d_arith_sin_fgINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  flgr_no_define_type_function(FLGR_INT32);
}

void flgr2d_arith_sin_fgFLOAT32(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  FLGR_MACRO_ARITH_2D_MONOADIC(flgr1d_arith_sin,fgFLOAT32);
}

void flgr2d_arith_sin_fgFLOAT64(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  FLGR_MACRO_ARITH_2D_MONOADIC(flgr1d_arith_sin,fgFLOAT64);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Sine on all pixels
 *  @param datdest : pointer to FLGR_Data2D
 *  @param data1 : pointer to FLGR_Data2D
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr2d_arith_sin(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  FLGR_Ret ret;

  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr2d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr2d_arith_sin,datdest,data1);

}

/*******************************************************************************
 * TAN
 *******************************************************************************/

void flgr2d_arith_tan_fgBIT(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  flgr_no_define_type_function(FLGR_BIT);
}
void flgr2d_arith_tan_fgUINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  flgr_no_define_type_function(FLGR_UINT8);
}

void flgr2d_arith_tan_fgUINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  flgr_no_define_type_function(FLGR_UINT16);
}

void flgr2d_arith_tan_fgUINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  flgr_no_define_type_function(FLGR_UINT32);
}

void flgr2d_arith_tan_fgINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  flgr_no_define_type_function(FLGR_INT8);
}

void flgr2d_arith_tan_fgINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  flgr_no_define_type_function(FLGR_INT16);
}

void flgr2d_arith_tan_fgINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  flgr_no_define_type_function(FLGR_INT32);
}

void flgr2d_arith_tan_fgFLOAT32(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  FLGR_MACRO_ARITH_2D_MONOADIC(flgr1d_arith_tan,fgFLOAT32);
}

void flgr2d_arith_tan_fgFLOAT64(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  FLGR_MACRO_ARITH_2D_MONOADIC(flgr1d_arith_tan,fgFLOAT64);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Tangent on all pixels
 *  @param datdest : pointer to FLGR_Data2D
 *  @param data1 : pointer to FLGR_Data2D
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr2d_arith_tan(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  FLGR_Ret ret;

  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr2d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr2d_arith_tan,datdest,data1);

}

/*******************************************************************************
 * ACOS
 *******************************************************************************/

void flgr2d_arith_acos_fgBIT(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  flgr_no_define_type_function(FLGR_BIT);
}
void flgr2d_arith_acos_fgUINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  flgr_no_define_type_function(FLGR_UINT8);
}

void flgr2d_arith_acos_fgUINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  flgr_no_define_type_function(FLGR_UINT16);
}

void flgr2d_arith_acos_fgUINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  flgr_no_define_type_function(FLGR_UINT32);
}

void flgr2d_arith_acos_fgINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  flgr_no_define_type_function(FLGR_INT8);
}

void flgr2d_arith_acos_fgINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  flgr_no_define_type_function(FLGR_INT16);
}

void flgr2d_arith_acos_fgINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  flgr_no_define_type_function(FLGR_INT32);
}

void flgr2d_arith_acos_fgFLOAT32(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  FLGR_MACRO_ARITH_2D_MONOADIC(flgr1d_arith_acos,fgFLOAT32);
}

void flgr2d_arith_acos_fgFLOAT64(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  FLGR_MACRO_ARITH_2D_MONOADIC(flgr1d_arith_acos,fgFLOAT64);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute arc cosine on all pixels
 *  @param datdest : pointer to FLGR_Data2D
 *  @param data1 : pointer to FLGR_Data2D
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr2d_arith_acos(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  FLGR_Ret ret;

  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr2d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr2d_arith_acos,datdest,data1);

}

/*******************************************************************************
 * ASIN
 *******************************************************************************/

void flgr2d_arith_asin_fgBIT(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  flgr_no_define_type_function(FLGR_BIT);
}
void flgr2d_arith_asin_fgUINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  flgr_no_define_type_function(FLGR_UINT8);
}

void flgr2d_arith_asin_fgUINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  flgr_no_define_type_function(FLGR_UINT16);
}

void flgr2d_arith_asin_fgUINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  flgr_no_define_type_function(FLGR_UINT32);
}

void flgr2d_arith_asin_fgINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  flgr_no_define_type_function(FLGR_INT8);
}

void flgr2d_arith_asin_fgINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  flgr_no_define_type_function(FLGR_INT16);
}

void flgr2d_arith_asin_fgINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  flgr_no_define_type_function(FLGR_INT32);
}

void flgr2d_arith_asin_fgFLOAT32(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  FLGR_MACRO_ARITH_2D_MONOADIC(flgr1d_arith_asin,fgFLOAT32);
}

void flgr2d_arith_asin_fgFLOAT64(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  FLGR_MACRO_ARITH_2D_MONOADIC(flgr1d_arith_asin,fgFLOAT64);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute arcsine on all pixels
 *  @param datdest : pointer to FLGR_Data2D
 *  @param data1 : pointer to FLGR_Data2D
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr2d_arith_asin(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  FLGR_Ret ret;

  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr2d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr2d_arith_asin,datdest,data1);

}

/*******************************************************************************
 * ATAN
 *******************************************************************************/

void flgr2d_arith_atan_fgBIT(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  flgr_no_define_type_function(FLGR_BIT);
}
void flgr2d_arith_atan_fgUINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  flgr_no_define_type_function(FLGR_UINT8);
}

void flgr2d_arith_atan_fgUINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  flgr_no_define_type_function(FLGR_UINT16);
}

void flgr2d_arith_atan_fgUINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  flgr_no_define_type_function(FLGR_UINT32);
}

void flgr2d_arith_atan_fgINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  flgr_no_define_type_function(FLGR_INT8);
}

void flgr2d_arith_atan_fgINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  flgr_no_define_type_function(FLGR_INT16);
}

void flgr2d_arith_atan_fgINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  flgr_no_define_type_function(FLGR_INT32);
}

void flgr2d_arith_atan_fgFLOAT32(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  FLGR_MACRO_ARITH_2D_MONOADIC(flgr1d_arith_atan,fgFLOAT32);
}

void flgr2d_arith_atan_fgFLOAT64(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  FLGR_MACRO_ARITH_2D_MONOADIC(flgr1d_arith_atan,fgFLOAT64);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Arc-Tangent on all pixels
 *  @param datdest : pointer to FLGR_Data2D
 *  @param data1 : pointer to FLGR_Data2D
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr2d_arith_atan(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  FLGR_Ret ret;

  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr2d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr2d_arith_atan,datdest,data1);

}





/*******************************************************************************
 * FLOOR
 *******************************************************************************/

void flgr2d_arith_floor_fgBIT(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  flgr_no_define_type_function(FLGR_BIT);
}
void flgr2d_arith_floor_fgUINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  flgr_no_define_type_function(FLGR_UINT8);
}

void flgr2d_arith_floor_fgUINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  flgr_no_define_type_function(FLGR_UINT16);
}

void flgr2d_arith_floor_fgUINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  flgr_no_define_type_function(FLGR_UINT32);
}

void flgr2d_arith_floor_fgINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  flgr_no_define_type_function(FLGR_INT8);
}

void flgr2d_arith_floor_fgINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  flgr_no_define_type_function(FLGR_INT16);
}

void flgr2d_arith_floor_fgINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  flgr_no_define_type_function(FLGR_INT32);
}

void flgr2d_arith_floor_fgFLOAT32(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  FLGR_MACRO_ARITH_2D_MONOADIC(flgr1d_arith_floor,fgFLOAT32);
}

void flgr2d_arith_floor_fgFLOAT64(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  FLGR_MACRO_ARITH_2D_MONOADIC(flgr1d_arith_floor,fgFLOAT64);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Arc-Tangent on all pixels
 *  @param datdest : pointer to FLGR_Data2D
 *  @param data1 : pointer to FLGR_Data2D
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr2d_arith_floor(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  FLGR_Ret ret;

  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr2d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr2d_arith_floor,datdest,data1);

}




/*******************************************************************************
 * CEIL
 *******************************************************************************/

void flgr2d_arith_ceil_fgBIT(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  flgr_no_define_type_function(FLGR_BIT);
}
void flgr2d_arith_ceil_fgUINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  flgr_no_define_type_function(FLGR_UINT8);
}

void flgr2d_arith_ceil_fgUINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  flgr_no_define_type_function(FLGR_UINT16);
}

void flgr2d_arith_ceil_fgUINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  flgr_no_define_type_function(FLGR_UINT32);
}

void flgr2d_arith_ceil_fgINT8(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  flgr_no_define_type_function(FLGR_INT8);
}

void flgr2d_arith_ceil_fgINT16(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  flgr_no_define_type_function(FLGR_INT16);
}

void flgr2d_arith_ceil_fgINT32(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  flgr_no_define_type_function(FLGR_INT32);
}

void flgr2d_arith_ceil_fgFLOAT32(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  FLGR_MACRO_ARITH_2D_MONOADIC(flgr1d_arith_ceil,fgFLOAT32);
}

void flgr2d_arith_ceil_fgFLOAT64(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  FLGR_MACRO_ARITH_2D_MONOADIC(flgr1d_arith_ceil,fgFLOAT64);
}

////////////////////////////////////////////////////////////////////////////
/*! Compute Arc-Tangent on all pixels
 *  @param datdest : pointer to FLGR_Data2D
 *  @param data1 : pointer to FLGR_Data2D
 *  @returns FLGR_RET_OK, ...
 */
//////////////////////////////////////////////////////////////////
FLGR_Ret flgr2d_arith_ceil(FLGR_Data2D *datdest, FLGR_Data2D *data1) {
  FLGR_Ret ret;

  FLGR_DECLARE_FUNCTION;

  if((datdest==NULL) || (data1==NULL)) {
    POST_ERROR("Null objects!\n");
    return FLGR_RET_NULL_OBJECT;
  }

  if((ret = flgr2d_is_data_same_attributes(datdest,data1,__FUNCTION__)) != FLGR_RET_OK) return ret;

  FLGR_DISPATCH_PROCEDURE(datdest->type,flgr2d_arith_ceil,datdest,data1);

}




//! @}
